public void ShouldAddBookGivenBook()
    {
        Member member = MemberHelpers.CreateWithDefaultConstructor();
        Book   book   = BookHelpers.GetDefaultTestBook();

        member.AddBookRead(book);

        Assert.Contains(book, member.BooksRead);
    }
예제 #2
0
    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 !);
    }