()
| 28 | |
| 29 | #[tokio::test] |
| 30 | async fn test_transaction_commit() { |
| 31 | run_test(async { |
| 32 | let pool = connection_pool().await; |
| 33 | let executor = Arc::new(RwLock::new(Executor::new(pool))); |
| 34 | // let mut uow = UnitOfWork::<Repository<BoardAggregate>, BoardAggregate>::new( |
| 35 | // connection.read().await.executor(), |
| 36 | // ); |
| 37 | |
| 38 | executor.write().await.begin().await.unwrap(); |
| 39 | |
| 40 | let mut board_repo: Repository<BoardAggregate> = |
| 41 | board_repository_helper(executor.clone()); |
| 42 | |
| 43 | let mut board_aggregate = board_create_helper(BoardState::Unpublished); |
| 44 | let id = board_repo.add(&mut board_aggregate).await.unwrap(); |
| 45 | |
| 46 | executor.write().await.commit().await.unwrap(); |
| 47 | |
| 48 | //TODO Should exist |
| 49 | |
| 50 | let _board_aggregate = board_repo.get(&id).await.unwrap(); |
| 51 | }) |
| 52 | .await; |
| 53 | } |
| 54 | |
| 55 | #[tokio::test] |
| 56 | async fn test_transaction_rollback() { |
nothing calls this directly
no test coverage detected