SparkyTestHelpers.Xml 1.0.0

Helpers to perform .config file XML transformations, and to test the resulting transformed XML (or actually any XML, whether it's .config format or not).

Install-Package SparkyTestHelpers.Xml -Version 1.0.0
dotnet add package SparkyTestHelpers.Xml --version 1.0.0
paket add SparkyTestHelpers.Xml --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

see also:


This NuGet package contains helpers to perform .config file XML transformations, and to test the resulting transformed XML (or actually any XML, whether it's .config format or not), e.g.:

using SparkyTestHelpers.Xml;
using SparkyTestHelpers.Xml.Config;
using SparkyTestHelpers.Xml.Transformation;
// In test setup/initialize method:
    TransformResults transformResults = 
        XmlTransformer
        .ForXmlFile("../../web.config")
        .TransformedByFile("web.release.config")
        .Transform();

    if (!transformResults.Successful)
    {
        Assert.Fail(transformResults.ErrorMessage);
    }

    _xmlTester = new XmlTester(transformResults.XDocument);

. . .

// In unit test method:
    _xmlTester.AssertAppSettingsValue("testKey", "expectedValue");

See https://github.com/BrianSchroer/sparky-test-helpers/blob/master/SparkyTestHelpers.Xml/api.md for complete API documentation for this package.

see also:


This NuGet package contains helpers to perform .config file XML transformations, and to test the resulting transformed XML (or actually any XML, whether it's .config format or not), e.g.:

using SparkyTestHelpers.Xml;
using SparkyTestHelpers.Xml.Config;
using SparkyTestHelpers.Xml.Transformation;
// In test setup/initialize method:
    TransformResults transformResults = 
        XmlTransformer
        .ForXmlFile("../../web.config")
        .TransformedByFile("web.release.config")
        .Transform();

    if (!transformResults.Successful)
    {
        Assert.Fail(transformResults.ErrorMessage);
    }

    _xmlTester = new XmlTester(transformResults.XDocument);

. . .

// In unit test method:
    _xmlTester.AssertAppSettingsValue("testKey", "expectedValue");

See https://github.com/BrianSchroer/sparky-test-helpers/blob/master/SparkyTestHelpers.Xml/api.md for complete API documentation for this package.

Version History

Version Downloads Last updated
1.0.0 100 3/2/2018