MCPcopy Create free account
hub / github.com/Migorithm/rustiful-backend / test_create_board

Function test_create_board

tests/service.rs:22–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20
21 #[tokio::test]
22 async fn test_create_board() {
23 run_test(async {
24 let (context_manager, _recv) = ContextManager::new().await;
25
26 let cmd = CreateBoard {
27 author: Uuid::new_v4(),
28 title: "Title!".to_string(),
29 content: "Content".to_string(),
30 state: BoardState::Published,
31 };
32
33 let mut uow = UnitOfWork::<Repository<BoardAggregate>>::new(context_manager.clone())
34 .await
35 .unwrap();
36 match ServiceHandler::create_board(cmd, context_manager.clone()).await {
37 Err(err) => '_fail_case: {
38 panic!("Service Handling Failed! {}", err)
39 }
40 Ok(id) => '_test: {
41 let id: String = id.try_into().unwrap();
42 if let Err(err) = uow.repository().get(&id).await {
43 panic!("Fetching newly created object failed! : {}", err);
44 };
45 }
46 }
47 })
48 .await;
49 }
50
51 #[tokio::test]
52 async fn test_edit_board() {

Callers

nothing calls this directly

Calls 4

create_boardFunction · 0.85
repositoryMethod · 0.80
run_testFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected