Пример #1
0
        public void GetAttributeValueUsingXPath()
        {
            string xpath = "//system.webServer/aspNetCore/@processPath";

            var expected = "aspnetcore.processpath";

            var actual = XmlEditorUtility.GetValueByXPath(_PathToSampleConfigFile, xpath);

            Assert.AreEqual <string>(expected, actual, "Wrong value.");
        }
        public void SetAttributeUsingThreeLevelsOfElement()
        {
            string expectedValue = "new-value";

            Args = CreateArgsArray(
                CommandNameArgument,
                GetArgEntry(Constants.ArgumentNameConfigFilename, _PathToSampleConfigFile),
                GetArgEntry(Constants.ArgumentNameLevel1, "configuration"),
                GetArgEntry(Constants.ArgumentNameLevel2, "system.webServer"),
                GetArgEntry(Constants.ArgumentNameLevel3, "aspNetCore"),
                GetArgEntry(Constants.ArgumentNameAttributeName, "processPath"),
                GetArgEntry(Constants.ArgumentNameValue, expectedValue));

            SystemUnderTest.Run();

            string xpath  = "//system.webServer/aspNetCore/@processPath";
            var    actual = XmlEditorUtility.GetValueByXPath(_PathToSampleConfigFile, xpath);

            Assert.AreEqual <string>(expectedValue, actual, "Result was wrong.");
        }