test: cascading in-memory store

This commit is contained in:
2026-10-25 22:19:24 +01:00
parent 51d92e08a7
commit 06eec2feae
72 changed files with 2439 additions and 1627 deletions

View File

@@ -1,7 +1,7 @@
use crate::test_support::create_goal_command;
use std::sync::Arc;
use domain::testing::{FakeStatsRepository, InMemoryGoalRepository, NoopEventPublisher};
use domain::testing::{FakeStatsRepository, InMemoryStore, NoopEventPublisher};
use uuid::Uuid;
use crate::goals::deps::GoalCommandDeps;
@@ -10,7 +10,7 @@ use crate::test_helpers::TestContextBuilder;
#[tokio::test]
async fn deletes_existing_goal() {
let goals = InMemoryGoalRepository::new();
let goals = InMemoryStore::new();
let stats = FakeStatsRepository::new();
let events = NoopEventPublisher::new();
let deps = GoalCommandDeps {
@@ -23,7 +23,7 @@ async fn deletes_existing_goal() {
create::execute(&deps, create_goal_command(2025, 10))
.await
.unwrap();
assert_eq!(goals.count(), 1);
assert_eq!(goals.goal_count(), 1);
delete::execute(
&deps,
@@ -35,7 +35,7 @@ async fn deletes_existing_goal() {
.await
.unwrap();
assert_eq!(goals.count(), 0);
assert_eq!(goals.goal_count(), 0);
}
#[tokio::test]