public void Given_no_previously_selected_revision_When_single_revision_selected_Then_AuthorEmailToHighlight_should_change() { var sut = new AuthorEmailBasedRevisionHighlighting(); var currentModule = NewModule(); sut.ProcessRevisionSelectionChange(currentModule, new[] { NewRevisionWithAuthorEmail(ExpectedAuthorEmail1) }); sut.AuthorEmailToHighlight.Should().Be(ExpectedAuthorEmail1); }
public void Given_no_previously_selected_revision_When_single_revision_selected_Then_ProcessSelectionChange_should_return_RefreshUserInterface() { var sut = new AuthorEmailBasedRevisionHighlighting(); var currentModule = NewModule(); var action = sut.ProcessRevisionSelectionChange(currentModule, new[] { NewRevisionWithAuthorEmail(ExpectedAuthorEmail1) }); action.Should().Be(AuthorEmailBasedRevisionHighlighting.SelectionChangeAction.RefreshUserInterface); }
public void Given_previously_selected_revision_When_single_revision_with_same_author_email_selected_Then_ProcessSelectionChange_should_return_NoAction() { var sut = new AuthorEmailBasedRevisionHighlighting(); var currentModule = NewModule(); sut.ProcessRevisionSelectionChange(currentModule, new[] { NewRevisionWithAuthorEmail(ExpectedAuthorEmail1) }); var action = sut.ProcessRevisionSelectionChange(currentModule, new[] { NewRevisionWithAuthorEmail(ExpectedAuthorEmail1) }); action.Should().Be(AuthorEmailBasedRevisionHighlighting.SelectionChangeAction.NoAction); }
public void Given_previously_selected_revision_When_no_revision_selected_Then_AuthorEmailToHighlight_should_be_value_of_current_user_email_setting() { var sut = new AuthorEmailBasedRevisionHighlighting(); var currentModule = NewModule(); currentModule.SetSetting(SettingKeyString.UserEmail, ExpectedAuthorEmail2); sut.ProcessRevisionSelectionChange(currentModule, new[] { NewRevisionWithAuthorEmail(ExpectedAuthorEmail1) }); sut.ProcessRevisionSelectionChange(currentModule, Array.Empty <GitRevision>()); sut.AuthorEmailToHighlight.Should().Be(ExpectedAuthorEmail2); }
public void Given_previously_selected_revision_When_no_revision_selected_Then_ProcessSelectionChange_should_return_RefreshUserInterface() { var sut = new AuthorEmailBasedRevisionHighlighting(); var currentModule = NewModule(); currentModule.SetSetting(SettingKeyString.UserEmail, ExpectedAuthorEmail2); sut.ProcessRevisionSelectionChange(currentModule, new[] { NewRevisionWithAuthorEmail(ExpectedAuthorEmail1) }); var action = sut.ProcessRevisionSelectionChange(currentModule, Array.Empty <GitRevision>()); action.Should().Be(AuthorEmailBasedRevisionHighlighting.SelectionChangeAction.RefreshUserInterface); }
public void When_multiple_revisions_selected_Then_ProcessSelectionChange_should_return_NoAction() { var sut = new AuthorEmailBasedRevisionHighlighting(); var currentModule = NewModule(); var action = sut.ProcessRevisionSelectionChange(currentModule, new[] { NewRevisionWithAuthorEmail(ExpectedAuthorEmail1), NewRevisionWithAuthorEmail(ExpectedAuthorEmail1) }); action.Should().Be(AuthorEmailBasedRevisionHighlighting.SelectionChangeAction.NoAction); }
public void AuthorEmailToHighlight_should_be_null_when_no_revision_change_processed_yet() { var sut = new AuthorEmailBasedRevisionHighlighting(); sut.AuthorEmailToHighlight.Should().BeNull(); }