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

            task = new GitBranch();
            task.BuildEngine = new MockBuild();
            task.RepositoryPath = TagFreeRepository;
        }
 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\")"));
 }
 public void TestParseStatusLineOnTag()
 {
     string statusLine = "# On branch 0.1.0";
     GitBranch gitBranch = new GitBranch();
     Assert.AreEqual("0.1.0", gitBranch.ParseStatusLineOutput(statusLine));
 }
 public void TestParseStatusLineOnMaster()
 {
     string statusLine = "# On branch master    ";
     GitBranch gitBranch = new GitBranch();
     Assert.AreEqual("master", gitBranch.ParseStatusLineOutput(statusLine));
 }