예제 #1
0
        public new void SetUp()
        {
            base.SetUp();

            task = new GitBranch();
            task.BuildEngine = new MockBuild();
            task.RepositoryPath = TagFreeRepository;
        }
예제 #2
0
 public void TestIsBranchStatusLine()
 {
     GitBranch gitBranch = new GitBranch();
     Assert.IsTrue(gitBranch.IsBranchStatusLine("# On branch 0.1"));
     Assert.IsFalse(gitBranch.IsBranchStatusLine("# Changes not staged for commit:"));
     Assert.IsFalse(gitBranch.IsBranchStatusLine("#   (use \"git add <file>...\" to update what will be committed)"));
     Assert.IsFalse(gitBranch.IsBranchStatusLine("#   (use \"git checkout -- <file>...\" to discard changes in working directory)"));
     Assert.IsFalse(gitBranch.IsBranchStatusLine("#"));
     Assert.IsFalse(gitBranch.IsBranchStatusLine("#       modified:   build/MSBuildCodeMetrics.build"));
     Assert.IsFalse(gitBranch.IsBranchStatusLine("#"));
     Assert.IsFalse(gitBranch.IsBranchStatusLine("# Untracked files:"));
     Assert.IsFalse(gitBranch.IsBranchStatusLine("#   (use \"git add <file>...\" to include in what will be committed)"));
     Assert.IsFalse(gitBranch.IsBranchStatusLine("#"));
     Assert.IsFalse(gitBranch.IsBranchStatusLine("#       build/git.bat"));
     Assert.IsFalse(gitBranch.IsBranchStatusLine("no changes added to commit (use \"git add\" and/or \"git commit -a\")"));
 }
예제 #3
0
 public void TestParseStatusLineOnTag()
 {
     string statusLine = "# On branch 0.1.0";
     GitBranch gitBranch = new GitBranch();
     Assert.AreEqual("0.1.0", gitBranch.ParseStatusLineOutput(statusLine));
 }
예제 #4
0
 public void TestParseStatusLineOnMaster()
 {
     string statusLine = "# On branch master    ";
     GitBranch gitBranch = new GitBranch();
     Assert.AreEqual("master", gitBranch.ParseStatusLineOutput(statusLine));
 }