Esempio n. 1
0
    public void ShouldReturnTrueIfBooksReadContainsBook()
    {
        UserBooksUpdateModel updateModel = GetUserBooksUpdateModelWithBookInBooksRead();

        bool hasReadBook = updateModel.HasReadBook(Book);

        Assert.True(hasReadBook);
    }
Esempio n. 2
0
    public void ShouldReturnFalseIfNoBooksInBooksRead()
    {
        UserBooksUpdateModel updateModel = GetUserBooksUpdateModel();

        bool hasReadBook = updateModel.HasReadBook(Book);

        Assert.False(hasReadBook);
    }
Esempio n. 3
0
    public void ShouldReturnTrueIfBooksReadContainsBookAndAnotherBook()
    {
        UserBooksUpdateModel updateModel = GetUserBooksUpdateModelWithBookInBooksRead();

        updateModel.BooksRead.Add(BookHelpers.GetDefaultTestBookWithSpecifiedTitle("C# for dummies"));

        bool hasReadBook = updateModel.HasReadBook(Book);

        Assert.True(hasReadBook);
    }
Esempio n. 4
0
    public void ShouldReturnFalseIfBooksReadContainsOtherBookButNotBookPassed()
    {
        UserBooksUpdateModel updateModel = GetUserBooksUpdateModel();

        updateModel.BooksRead.Add(new DevBetterWeb.Core.Entities.Book {
            Author = "Steve Smith", Title = "C# stuff", Details = "A book about c#", PurchaseUrl = "https://buyabook.com"
        });

        bool hasReadBook = updateModel.HasReadBook(Book);

        Assert.False(hasReadBook);
    }