public void TestGetBooksFromNullAuthor() { IBookServices bsi = new BookServicesImplementation(); var books = bsi.GetBooksFromAuthor(null); Assert.AreEqual(0, books.Count); }
public void TestBookHasOnlyDOMDomains() { IBookServices bsi = new BookServicesImplementation(); Book book = new Book { Title = "gbujyhgb", Domains = new List <Domain> { new Domain { Name = "Arts & Music" }, new Domain { Name = "Business" }, new Domain { Name = "Kids" } } }; bool flag = bsi.BookHasOnlyDOMDomains(book); Assert.IsTrue(flag); }
public void TestBookHasMoreThanDOMDomains() { IBookServices bsi = new BookServicesImplementation(); Book book = new Book { Title = "gbujyhgb", Domains = new List <Domain> { new Domain { Name = "Arts & Music" }, new Domain { Name = "Business" }, new Domain { Name = "Kids" }, new Domain { Name = "Computers & Tech" }, new Domain { Name = "Cooking" }, new Domain { Name = "Science & Math" }, } }; bool flag = bsi.BookHasOnlyDOMDomains(book); Assert.IsFalse(flag); }
public void TestGetBooksFromAuthor() { IBookServices bsi = new BookServicesImplementation(); IAuthorServices asi = new AuthorServicesImplementation(); var author = asi.GetAuthorByName("Bert Bates"); var books = bsi.GetBooksFromAuthor(author); Assert.AreEqual(1, books.Count); }
public void TestGetBooksFromParentDomain() { IBookServices bsi = new BookServicesImplementation(); IDomainServices dsi = new DomainServicesImplementation(); var domain = dsi.GetDomainByName("Kids"); var books = bsi.GetBooksFromDomain(domain); Assert.AreEqual(1, books.Count); }
public void TestBookDomainContainsParentDomain() { IBookServices bsi = new BookServicesImplementation(); IDomainServices dsi = new DomainServicesImplementation(); Book book = new Book { Title = "Tiitlee", Domains = new List <Domain> { dsi.GetDomainByName("Computer Science"), dsi.GetDomainByName("Databases") } }; bool flag = bsi.BookDomainContainsParentDomain(book); Assert.IsFalse(flag); }
public void TestBookHasDataServiceWithNoArgument() { bookServices = new BookServicesImplementation(); }
public void TestBookHasDataServiceWithArgument() { bookServices = new BookServicesImplementation(bookDataServices); Assert.IsTrue(bookServices != null); }
public void SetUp() { bookDataServices = MockRepository.GenerateMock <IBookDataServices>(); bookServices = new BookServicesImplementation(bookDataServices); }