public void Initalize() { var adapter = new LibraryCardAdapter(); JaneDoeCard = adapter.AddLibraryCard(new LibraryCardBuilder().JaneDoeCard( ObjectMother.Instance.Customers.JaneDoe).Build()); JhonDoeCard = adapter.AddLibraryCard(new LibraryCardBuilder().JohnDoeCard( ObjectMother.Instance.Customers.JohnDoe).Build()); adapter.SaveChanges(); }
public void ResetAndInitializeTestData() { ObjectMother.ObjectMother.ClearTestData(); ObjectMother.ObjectMother.Instance.VerifyInitialization(); var bookAdapter = new BookAdapter(); var customerAdapter = new CustomerAdapter(); var libraryCardAdapter = new LibraryCardAdapter(); Assert.IsTrue(bookAdapter.Search(new Contracts.Books.SearchFilters(), null).PageData.Any(), "There are no test books"); Assert.IsTrue(customerAdapter.Search(new Contracts.Customers.SearchFilters(), null).PageData.Any(), "There are no test customers"); Assert.IsTrue(libraryCardAdapter.Search(new Contracts.LibraryCards.SearchFilters(), null).PageData.Any(), "There are no test library cards"); }
public void AdapterAddLibraryCardTest() { var customer = CustomerWaldo.PrepareJohnDoeCustomer(); var expected = new LibraryCardBuilder().JohnDoeCard(customer).Build(); var adapter = new LibraryCardAdapter(); var response = adapter.AddLibraryCard(expected); Assert.IsNotNull(response); var comparison = Utilities.CompareObjects(expected, response); Assert.IsTrue(comparison.AreEqual, $"Expected [{expected}] Actual [{response}]"); }