コード例 #1
0
    public void TestXmlCycle3()
    {
        var serializer = serializerFactory.GetSerializer().Create();

        var xmlStr = serializer.Serialize(
            new XmlWriterSettings(),
            new TestRoot {
            CartTitle = ExpectedTitleStr
        }
            );
        var restoredRoot = serializer.Deserialize <TestRoot>(xmlStr);

        xmlStr.Should().Contain($"CartTitle=\"{ExpectedTitleStr}\"");

        restoredRoot.CartTitle.Should().Be(ExpectedTitleStr);
    }
コード例 #2
0
 private IConfigurationContainer GetSerializerConfig() =>
 xmlSerializerFactory.GetSerializer();