tests/TestCommitFiltering.cs
/// <summary>
/// Appends the message "This is a test" to all commits.
/// </summary>
Appends the message "This is a test" to all commits.
Appends the message " This is a test " to all commits .
[Fact]
        public void ModifyCommitMessageAll()
        {
            var test = InitializeTest();
            Assert.Equal(0, Program.Main("--commit-filter",
                @"commit.Message += ""This is a test"";",
                "--repo-dir", test.Path,
                "--branch", NewBranch,
                @"HEAD"));
            var repo = test.Repo;
            var headNewMaster = AssertBranchRef(repo);
            var originalCommits = GetCommits(repo);
            var newCommits = GetCommits(repo, headNewMaster);
            Assert.Equal(originalCommits.Count, newCommits.Count);
            for (int i = 0; i < newCommits.Count; i++)
            {
                var originalCommit = originalCommits[i];
                var commit = newCommits[i];
                Assert.Equal(originalCommit.Tree.Id, commit.Tree.Id);
                Assert.EndsWith("This is a test", commit.Message);
                Assert.StartsWith(originalCommit.Message, commit.Message);
            }
            test.Dispose();
        }
[ Fact ] public void ModifyCommitMessageAll ( ) { var test = InitializeTest ( ) ; Assert . Equal ( 0 , Program . Main ( " " , @"commit.Message += ""This is a test"";" , " " , test . Path , " " , NewBranch , @"HEAD" ) ) ; var repo = test . Repo ; var headNewMaster = AssertBranchRef ( repo ) ; var originalCommits = GetCommits ( repo ) ; var newCommits = GetCommits ( repo , headNewMaster ) ; Assert . Equal ( originalCommits . Count , newCommits . Count ) ; for ( int i = 0 ; i < newCommits . Count ; i ++ ) { var originalCommit = originalCommits [ i ] ; var commit = newCommits [ i ] ; Assert . Equal ( originalCommit . Tree . Id , commit . Tree . Id ) ; Assert . EndsWith ( " " , commit . Message ) ; Assert . StartsWith ( originalCommit . Message , commit . Message ) ; } test . Dispose ( ) ; }
Appends the message "This is a test" to all commits.
Appends the message " This is a test " to all commits .
// Test directly the main program as we want to test also command line parameters // Make sure that we have the same number of commits // All commits should have same tree id // Check the new message // Cleanup the test only if we succeed