Esempio n. 1
0
        public void XmlGetElementTests_WhenValuesAreValidUsingWorkflowShouldReplaceXmlValueProperly()
        {
            const string xmlNamespace       = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd";
            const string xpathExpression    = "ns:package/ns:metadata/ns:version";
            const string xmlNamespacePrefix = "ns";

            // Create an instance of our test workflow
            var workflow = new CallXmlGetElementWorkflow();

            // Create the workflow run-time environment
            var workflowInvoker = new WorkflowInvoker(workflow);

            // Set the workflow arguments
            workflow.FilePath           = "TestLib.nuspec";
            workflow.XmlNamespace       = xmlNamespace;
            workflow.XmlNamespacePrefix = xmlNamespacePrefix;
            workflow.XPathExpression    = xpathExpression;

            // Invoke the workflow and capture the outputs
            var output = workflowInvoker.Invoke();

            var elementValue = (string)output["ElementValue"];

            Assert.AreEqual("0.9.4156.32354", elementValue);
        }
        public void XmlGetElementTests_WhenValuesAreValidUsingWorkflowShouldReplaceXmlValueProperly()
        {
            const string xmlNamespace = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd";
            const string xpathExpression = "ns:package/ns:metadata/ns:version";
            const string xmlNamespacePrefix = "ns";

            // Create an instance of our test workflow
            var workflow = new CallXmlGetElementWorkflow();

            // Create the workflow run-time environment
            var workflowInvoker = new WorkflowInvoker(workflow);

            // Set the workflow arguments
            workflow.FilePath = "TestLib.nuspec";
            workflow.XmlNamespace = xmlNamespace;
            workflow.XmlNamespacePrefix = xmlNamespacePrefix;
            workflow.XPathExpression = xpathExpression;

            // Invoke the workflow and capture the outputs
            var output = workflowInvoker.Invoke();

            var elementValue = (string)output["ElementValue"];

            Assert.AreEqual("0.9.4156.32354", elementValue);
        }