private async Task <Book> InsertBook()
        {
            var book = BookFactoryTest.Create();

            await _bookRepository.Create(book);

            return(book);
        }
Exemple #2
0
 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);
        }
Exemple #4
0
        public async Task find_a_book_from_database()
        {
            var book = BookFactoryTest.Create();

            await InsertABook(book);

            var oneBook = await _repository.Find();

            oneBook.Should().Be(book);
        }
Exemple #5
0
        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();
        }
Exemple #6
0
        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";
 }