public void ShouldAddBookGivenBook() { Member member = MemberHelpers.CreateWithDefaultConstructor(); Book book = BookHelpers.GetDefaultTestBook(); member.AddBookRead(book); Assert.Contains(book, member.BooksRead); }
public void ShouldReturnTrueIfBooksReadContainsBookAndAnotherBook() { UserBooksUpdateModel updateModel = GetUserBooksUpdateModelWithBookInBooksRead(); updateModel.BooksRead.Add(BookHelpers.GetDefaultTestBookWithSpecifiedTitle("C# for dummies")); bool hasReadBook = updateModel.HasReadBook(Book); Assert.True(hasReadBook); }
public void ShouldDoNothingGivenBookNotInBooksRead() { Member member = MemberHelpers.CreateWithDefaultConstructor(); Book book = BookHelpers.GetDefaultTestBook(); member.RemoveBookRead(book); // if we get this far, no error was thrown Assert.Empty(member.BooksRead); }
public void ShouldDoNothingGivenDuplicateBook() { Member member = MemberHelpers.CreateWithDefaultConstructor(); Book book = BookHelpers.GetDefaultTestBook(); member.AddBookRead(book); member.AddBookRead(book); // if we get to this point no error was thrown. Assert.Contains(book, member.BooksRead); Assert.Single(member.BooksRead !); }