public void Test()
        {
            GitDescribe task = new GitDescribe();
            var buildEngineMock = new Mock<IBuildEngine3>();
            buildEngineMock.SetupAllProperties();
            task.BuildEngine = buildEngineMock.Object;

            Assert.IsTrue(task.Execute(), task.StandardError);
        }
        public void Test()
        {
            GitDescribe task            = new GitDescribe();
            var         buildEngineMock = new Mock <IBuildEngine3>();

            buildEngineMock.SetupAllProperties();
            task.BuildEngine = buildEngineMock.Object;

            Assert.IsTrue(task.Execute(), task.StandardError);
        }
Exemple #3
0
        public void GitDescribeExecute()
        {
            var task = new GitDescribe();

            task.BuildEngine = new MockBuild();
            task.ToolPath    = @"C:\Program Files (x86)\Git\bin";

            string prjRootPath = TaskUtility.GetProjectRootDirectory(true);

            task.LocalPath = Path.Combine(prjRootPath, @"Source");

            bool result = task.Execute();

            Assert.IsTrue(result, "Execute Failed");

            Assert.AreNotEqual(task.CommitCount, -1); // -1 designates a soft error.  Only should occur in soft error mode
            Assert.IsFalse(string.IsNullOrEmpty(task.CommitHash), "Invalid Revision Number");
        }