public void LibraryLogicGetBookCatalogTest() { Library.AddBook(new Data.Book(1, "Maly Ksiaze", "Saint-Exupery", 120, Data.BookGenre.Childrens, new DateTime(1943, 4, 6))); Assert.AreEqual(1, Library.GetBook(1).Id); Assert.AreEqual("Maly Ksiaze", Library.GetBook(1).Title); Assert.AreEqual("Saint-Exupery", Library.GetBook(1).Author); Assert.AreEqual(120, repository.GetBook(1).Pages); Assert.AreEqual(Data.BookGenre.Childrens, Library.GetBook(1).Genre); Assert.AreEqual(new DateTime(1943, 4, 6), Library.GetBook(1).Date_of_publication); }
public void DataRepositoryGetBookTest() { repository.AddBook(new Data.Book(4, "Nie ma", "Mariusz Szczygiel", 332, Data.BookGenre.Personal, new DateTime(2018, 6, 12))); Assert.AreEqual(4, repository.GetBook(4).Id); Assert.AreEqual("Nie ma", repository.GetBook(4).Title); Assert.AreEqual("Mariusz Szczygiel", repository.GetBook(4).Author); Assert.AreEqual(332, repository.GetBook(4).Pages); Assert.AreEqual(Data.BookGenre.Personal, repository.GetBook(4).Genre); Assert.AreEqual(new DateTime(2018, 6, 12), repository.GetBook(4).Date_of_publication); }
public Data.Book GetBook(int num) { return(repository.GetBook(num)); }