add 400+ unit tests for domain and application layers
Some checks failed
CI / Check / Test (push) Has been cancelled
Some checks failed
CI / Check / Test (push) Has been cancelled
Extract ReviewLogger trait to decouple import/integrations from diary::log_review (cross-module coupling smell). Add in-memory fakes for all repository ports, enabling isolated testing of every use case module without a database. Coverage: domain+application 22% → 80%, 427 tests.
This commit is contained in:
22
crates/application/src/diary/tests/get_diary.rs
Normal file
22
crates/application/src/diary/tests/get_diary.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
use crate::{diary::get_diary, diary::queries::GetDiaryQuery, test_helpers::TestContextBuilder};
|
||||
|
||||
#[tokio::test]
|
||||
async fn returns_empty_page() {
|
||||
let ctx = TestContextBuilder::new().build();
|
||||
|
||||
let result = get_diary::execute(
|
||||
&ctx,
|
||||
GetDiaryQuery {
|
||||
limit: None,
|
||||
offset: None,
|
||||
sort_by: None,
|
||||
movie_id: None,
|
||||
user_id: None,
|
||||
},
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
assert!(result.items.is_empty());
|
||||
assert_eq!(result.total_count, 0);
|
||||
}
|
||||
Reference in New Issue
Block a user