Example #1
0
        public void TestSearchBooksByMockingAdapter()
        {
            var adapter = new BookAdapterMocks().MockSearch().Build();
            var filters = new SearchFilters();

            var repo   = new Orchestrations.BookOrchestration.BookOrchestrator(adapter);
            var result = repo.Search(filters, null);

            Assert.IsNotNull(result);
            Assert.IsTrue(result.PageData.Any());
        }
Example #2
0
        public void TestAddBookByMockingAdapter()
        {
            var adapter = new BookAdapterMocks().MockAddBook().Build();
            var newBook = new BookBuilder().FiveDysfunctions().Build();

            var repo   = new Orchestrations.BookOrchestration.BookOrchestrator(adapter);
            var result = repo.AddBook(newBook);

            Assert.IsNotNull(result);
            Assert.AreEqual(newBook, result);
        }