示例#1
0
        public void LoadXmlFromFile()
        {
            task = new XmlQuery();
            task.BuildEngine = new MockBuild();

            string prjRootPath = TaskUtility.getProjectRootDirectory(true);
            task.XmlFileName = System.IO.Path.Combine(prjRootPath, @"Source\Subversion.proj");
            task.XPath = "count(/n:Project/n:PropertyGroup/*)";
            task.NamespaceDefinitions = new ITaskItem[] {
                new TaskItem("n=http://schemas.microsoft.com/developer/msbuild/2003")
            };

            Assert.IsTrue(task.Execute(), "Should have executed successfully.");
            Assert.AreEqual("6", task.Values[0].ToString());
        }
示例#2
0
 public void SpecifyNeitherLinesNorXmlFileName_ReturnFalse()
 {
     task = new XmlQuery();
     task.BuildEngine = new MockBuild();
     task.XPath = "count(/configuration/appSettings/*)";
     Assert.IsFalse(task.Execute(), "Should have failed to execute.");
 }
示例#3
0
 public void setupTask(string xml)
 {
     task = new XmlQuery();
     task.BuildEngine = new MockBuild();
     task.Lines = new ITaskItem[] { new TaskItem(@"<?xml version=""1.0"" encoding=""utf-8"" ?>"), new TaskItem(xml) };
 }