public void ShouldBuild_WhenUseRedditIsTrueAndRedditAccessToken_ExpectTrue() { const bool useReddit = true; const bool hasRedditAccessToken = true; IDashboardSettings dashboardSettings = CreateDashboardSettings(useReddit: useReddit, hasRedditAccessToken: hasRedditAccessToken); IDashboardRedditContentBuilder sut = CreateSut(); bool result = sut.ShouldBuild(dashboardSettings); Assert.IsTrue(result); }
public void ShouldBuild_WhenCalled_AssertRedditAccessTokenWasCalledOnDashboardSettings() { const bool useReddit = true; bool hasRedditAccessToken = _random.Next(100) > 50; Mock <IDashboardSettings> dashboardSettingsMock = CreateDashboardSettingsMock(useReddit: useReddit, hasRedditAccessToken: hasRedditAccessToken); IDashboardRedditContentBuilder sut = CreateSut(); bool result = sut.ShouldBuild(dashboardSettingsMock.Object); dashboardSettingsMock.Verify(m => m.RedditAccessToken, Times.Once); }
public void ShouldBuild_WhenUseRedditIsFalse_ExpectFalse() { const bool useReddit = false; bool hasRedditAccessToken = _random.Next(100) > 50; IDashboardSettings dashboardSettings = CreateDashboardSettings(useReddit: useReddit, hasRedditAccessToken: hasRedditAccessToken); IDashboardRedditContentBuilder sut = CreateSut(); bool result = sut.ShouldBuild(dashboardSettings); Assert.IsFalse(result); }
public void ShouldBuild_WhenDashboardSettingsIsNull_ThrowsArgumentNullException() { IDashboardRedditContentBuilder sut = CreateSut(); sut.ShouldBuild(null); }