public void ShouldUseFullHeaderAsSubjectIfNoTypeWasGivenButSubjectUsesColon()
        {
            var testCommit         = new TestCommit("c360d6a307909c6e571b29d4a329fd786c5d4543", "broadcast $destroy event: on scope destruction");
            var conventionalCommit = ConventionalCommitParser.Parse(testCommit);

            Assert.Equal(testCommit.Message, conventionalCommit.Subject);
        }
        public void ShouldUseFullHeaderAsSubjectIfNoTypeWasGivenButSubjectUsesColon()
        {
            var parser = new ConventionalCommitParser();

            var testCommit         = new TestCommit("broadcast $destroy event: on scope destruction");
            var conventionalCommit = parser.Parse(testCommit);

            Assert.Equal(testCommit.Message, conventionalCommit.Subject);
        }
        public void ShouldParseTypeScopeAndSubjectFromSingleLineCommitMessage()
        {
            var testCommit         = new TestCommit("c360d6a307909c6e571b29d4a329fd786c5d4543", "feat(scope): broadcast $destroy event on scope destruction");
            var conventionalCommit = ConventionalCommitParser.Parse(testCommit);

            Assert.Equal("feat", conventionalCommit.Type);
            Assert.Equal("scope", conventionalCommit.Scope);
            Assert.Equal("broadcast $destroy event on scope destruction", conventionalCommit.Subject);
        }
        public void ShouldParseTypeScopeAndSubjectFromSingleLineCommitMessageIfSubjectUsesColon()
        {
            var parser = new ConventionalCommitParser();

            var testCommit         = new TestCommit("feat(scope): broadcast $destroy: event on scope destruction");
            var conventionalCommit = parser.Parse(testCommit);

            Assert.Equal("feat", conventionalCommit.Type);
            Assert.Equal("scope", conventionalCommit.Scope);
            Assert.Equal("broadcast $destroy: event on scope destruction", conventionalCommit.Subject);
        }
        public void ShouldExtractCommitNotes()
        {
            var testCommit         = new TestCommit("c360d6a307909c6e571b29d4a329fd786c5d4543", "feat(scope): broadcast $destroy: event on scope destruction\nBREAKING CHANGE: this will break rc1 compatibility");
            var conventionalCommit = ConventionalCommitParser.Parse(testCommit);

            Assert.Single(conventionalCommit.Notes);

            var breakingChangeNote = conventionalCommit.Notes.Single();

            Assert.Equal("BREAKING CHANGE", breakingChangeNote.Title);
            Assert.Equal("this will break rc1 compatibility", breakingChangeNote.Text);
        }