Exemple #1
0
        public void ShouldBuild_WhenCalled_AssertNumberOfNewsWasCalledOnDashboardSettings()
        {
            Mock <IDashboardSettings> dashboardSettingsMock = CreateDashboardSettingsMock();

            IDashboardNewsBuilder sut = CreateSut();

            bool result = sut.ShouldBuild(dashboardSettingsMock.Object);

            dashboardSettingsMock.Verify(m => m.NumberOfNews, Times.Once);
        }
Exemple #2
0
        public void ShouldBuild_WhenNumberOfNewsInDashboardSettingsIsEqualToZero_ReturnsFalse()
        {
            const int          numberOfNews      = 0;
            IDashboardSettings dashboardSettings = CreateDashboardSettings(numberOfNews);

            IDashboardNewsBuilder sut = CreateSut();

            bool result = sut.ShouldBuild(dashboardSettings);

            Assert.IsFalse(result);
        }
Exemple #3
0
        public void ShouldBuild_WhenNumberOfNewsInDashboardSettingsIsEqualToZero_AssertOnlyNsfwContentWasNotCalledOnDashboardSettings()
        {
            const int numberOfNews = 0;
            Mock <IDashboardSettings> dashboardSettingsMock = CreateDashboardSettingsMock(numberOfNews);

            IDashboardNewsBuilder sut = CreateSut();

            bool result = sut.ShouldBuild(dashboardSettingsMock.Object);

            dashboardSettingsMock.Verify(m => m.OnlyNsfwContent, Times.Never);
        }
Exemple #4
0
        public void ShouldBuild_WhenNumberOfNewsInDashboardSettingsIsLowerThanZero_ReturnsFalse()
        {
            int numberOfNews = _random.Next(1, 10) * -1;
            IDashboardSettings dashboardSettings = CreateDashboardSettings(numberOfNews);

            IDashboardNewsBuilder sut = CreateSut();

            bool result = sut.ShouldBuild(dashboardSettings);

            Assert.IsFalse(result);
        }
Exemple #5
0
        public void ShouldBuild_WhenNumberOfNewsInDashboardSettingsIsLowerThanZero_AssertOnlyNsfwContentWasNotCalledOnDashboardSettings()
        {
            int numberOfNews = _random.Next(1, 10) * -1;
            Mock <IDashboardSettings> dashboardSettingsMock = CreateDashboardSettingsMock(numberOfNews);

            IDashboardNewsBuilder sut = CreateSut();

            bool result = sut.ShouldBuild(dashboardSettingsMock.Object);

            dashboardSettingsMock.Verify(m => m.OnlyNsfwContent, Times.Never);
        }
Exemple #6
0
        public void ShouldBuild_WhenNumberOfNewsInDashboardSettingsIsGreaterThanZeroAndOnlyNsfwContentInDashboardSettingsIsFalse_ReturnsTrue()
        {
            int                numberOfNews      = _random.Next(1, 10);
            const bool         onlyNsfwContent   = false;
            IDashboardSettings dashboardSettings = CreateDashboardSettings(numberOfNews, onlyNsfwContent);

            IDashboardNewsBuilder sut = CreateSut();

            bool result = sut.ShouldBuild(dashboardSettings);

            Assert.IsTrue(result);
        }
Exemple #7
0
        public void ShouldBuild_WhenDashboardSettingsIsNull_ThrowsArgumentNullException()
        {
            IDashboardNewsBuilder sut = CreateSut();

            sut.ShouldBuild(null);
        }