Ejemplo n.º 1
0
        public void XmlFile_ValidateXmlTest()
        {
            // Arrange
            var target = new TfsBuildExtensions.Activities.Xml.Xml {
                Action = XmlAction.Transform
            };

            // Define activity arguments
            var arguments = new Dictionary <string, object>
            {
                { "XmlText", @"<?xml version=""1.0""?>
                    <catalog>
                       <book id=""bk101"">
                          <author>Gambardella, Matthew</author>
                          <title>XML Developer's Guide</title>
                          <genre>Computer</genre>
                          <price>44.95</price>
                          <publish_date>2000-10-01</publish_date>
                          <description>An in-depth look at creating applications 
                          with XML.</description>
                       </book>
                    </catalog>
                    " },
                { "XslTransform", @"<xsl:transform version=""1.0"" xmlns:xsl=""http://www.w3.org/1999/XSL/Transform""/>" },
            };

            // Act
            WorkflowInvoker invoker = new WorkflowInvoker(target);
            var             result  = invoker.Invoke(arguments);

            // Assert
            Assert.IsFalse((bool)result["IsValid"]);
        }
Ejemplo n.º 2
0
        public void XmlFile_ValidateXmlTest()
        {
            // Arrange
            var target = new TfsBuildExtensions.Activities.Xml.Xml { Action = XmlAction.Transform };

            // Define activity arguments
            var arguments = new Dictionary<string, object>
            {
                { "XmlText", @"<?xml version=""1.0""?>
                    <catalog>
                       <book id=""bk101"">
                          <author>Gambardella, Matthew</author>
                          <title>XML Developer's Guide</title>
                          <genre>Computer</genre>
                          <price>44.95</price>
                          <publish_date>2000-10-01</publish_date>
                          <description>An in-depth look at creating applications 
                          with XML.</description>
                       </book>
                    </catalog>
                    " },
                { "XslTransform", @"<xsl:transform version=""1.0"" xmlns:xsl=""http://www.w3.org/1999/XSL/Transform""/>" },
            };

            // Act
            WorkflowInvoker invoker = new WorkflowInvoker(target);
            var result = invoker.Invoke(arguments);

            // Assert
            Assert.IsFalse((bool)result["IsValid"]);
        }