Ejemplo n.º 1
0
        public void GetComment_With_No_SelectedCommitType_ShouldBe_Empty(IUserSettings userSettings)
        {
            var sut = new CommitizenViewModel(userSettings);

            sut.SelectedCommitType = null;
            sut.GetComment().ShouldBeEmpty();
        }
Ejemplo n.º 2
0
        public void GetComment_ShouldNot_Take_Last_Space_If_Over_ChunkSize(IUserSettings userSettings)
        {
            userSettings.MaxLineLength = 10;

            var sut = new CommitizenViewModel(userSettings);

            sut.SelectedCommitType = sut.CommitTypes.First(f => f.Type.Contains("feat"));
            sut.Scope = "test";
            sut.Body  = "test";
            sut.Body += " tenwordsss tenwordsss";
            sut.GetComment().ShouldBe("feat(test): \n\ntest\ntenwordsss\ntenwordsss");
        }
        public void Copy_Should_Contains_Comment_Message(CommitizenViewModel sut)
        {
            Clipboard.Clear();
            var expectedComment = sut.GetComment();

            // Act
            sut.CopyMessage(null);

            // Assert
            var comment = Clipboard.GetText();

            comment.ShouldBe(expectedComment);
        }
 public void GetComment_ShouldNot_Prefix_Issues_If_NotNumber(CommitizenViewModel sut)
 {
     sut.IssuesAffected = "666 & 999";
     sut.GetComment().ShouldEndWith($"\n\ncloses {sut.IssuesAffected}");
 }
 public void GetComment_Should_Prefix_Issues_If_Number(CommitizenViewModel sut)
 {
     sut.IssuesAffected = "666";
     sut.GetComment().ShouldEndWith("\n\ncloses #666");
 }
 public void GetComment_Should_Suffix_Type_If_Highlight_BreakingChanges(CommitizenViewModel sut)
 {
     sut.BreakingChanges         = "no more login !";
     sut.HighlighBreakingChanges = true;
     sut.GetComment().ShouldStartWith($"{sut.SelectedCommitType.Type}({sut.Scope})!:");
 }
 public void GetComment_Should_Prefix_BreakingChanges(CommitizenViewModel sut)
 {
     sut.BreakingChanges = "no more login !";
     sut.GetComment().ShouldContain($"BREAKING CHANGE: {sut.BreakingChanges}");
 }
 public void GetComment_With_No_Body(CommitizenViewModel sut)
 {
     sut.IssuesAffected = sut.Body = sut.BreakingChanges = null;
     sut.GetComment().ShouldBe($"{sut.SelectedCommitType.Type}({sut.Scope}): {sut.Subject}");
 }
 public void GetComment_With_Scope(CommitizenViewModel sut)
 {
     sut.GetComment().ShouldStartWith($"{sut.SelectedCommitType.Type}({sut.Scope}): ");
 }