private async Task <Book> InsertBook() { var book = BookFactoryTest.Create(); await _bookRepository.Create(book); return(book); }
private async Task InsertTwoBooks() { for (int i = 0; i < 2; i++) { var book = BookFactoryTest.Create(); await InsertABook(book); } }
public async Task should_create_book_aggregate() { var book = BookFactoryTest.Create(); await _bookRepository.Create(book); var insertedBook = await _bookRepository.Get(book.Id); insertedBook.Should().Be(book); }
public async Task find_a_book_from_database() { var book = BookFactoryTest.Create(); await InsertABook(book); var oneBook = await _repository.Find(); oneBook.Should().Be(book); }
public async Task read_a_book_from_database() { var book = BookFactoryTest.Create(); await InsertABook(book); var first = await _repository.Get(book.Id); first.Should().NotBeNull(); }
public async Task Create_book_aggregate() { var book = BookFactoryTest.Create(); await _repository.Create(book); await _db.SaveChangesAsync(); var first = _db.Books.First(); first.Should().NotBeNull(); }
public LiteDbRepositoryTest() { _bookRepository = new BookRepositoryFake(Db); _book = BookFactoryTest.Create(); }
public UncommittedEventHandlerTest() { _bookRepository = new BookRepositoryFake(Db); _aggregate = BookFactoryTest.Create(); _eventsCollectionName = "Events"; }