test: shared factories and command builders
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
use crate::test_support::create_goal_command;
|
||||
use std::sync::Arc;
|
||||
|
||||
use domain::testing::{FakeStatsRepository, InMemoryGoalRepository, NoopEventPublisher};
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::goals::deps::GoalCommandDeps;
|
||||
use crate::goals::{
|
||||
commands::{CreateGoalCommand, DeleteGoalCommand},
|
||||
create, delete,
|
||||
};
|
||||
use crate::goals::{commands::DeleteGoalCommand, create, delete};
|
||||
use crate::test_helpers::TestContextBuilder;
|
||||
|
||||
#[tokio::test]
|
||||
@@ -22,16 +20,9 @@ async fn deletes_existing_goal() {
|
||||
event_publisher: Arc::clone(&events) as _,
|
||||
};
|
||||
|
||||
create::execute(
|
||||
&deps,
|
||||
CreateGoalCommand {
|
||||
user_id: Uuid::nil(),
|
||||
year: 2025,
|
||||
target_count: 10,
|
||||
},
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
create::execute(&deps, create_goal_command(2025, 10))
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(goals.count(), 1);
|
||||
|
||||
delete::execute(
|
||||
|
||||
Reference in New Issue
Block a user