Beispiel #1
0
        public void WriteElementExtensions_Invoke_ReturnsExpected(string version)
        {
            var person = new SyndicationPersonSubclass();

            CompareHelper.AssertEqualWriteOutput("", writer => person.WriteElementExtensionsEntryPoint(writer, version));

            person.ElementExtensions.Add(new ExtensionObject {
                Value = 10
            });
            person.ElementExtensions.Add(new ExtensionObject {
                Value = 11
            });
            CompareHelper.AssertEqualWriteOutput(
                @"<SyndicationPersonTests.ExtensionObject xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""http://schemas.datacontract.org/2004/07/System.ServiceModel.Syndication.Tests"">
    <Value>10</Value>
</SyndicationPersonTests.ExtensionObject>
<SyndicationPersonTests.ExtensionObject xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""http://schemas.datacontract.org/2004/07/System.ServiceModel.Syndication.Tests"">
    <Value>11</Value>
</SyndicationPersonTests.ExtensionObject>", writer => person.WriteElementExtensionsEntryPoint(writer, version));
        }
Beispiel #2
0
        public void WriteElementExtensions_Item_Success(string version)
        {
            var item = new SyndicationItem();

            CompareHelper.AssertEqualWriteOutput("", writer => Formatter.WriteElementExtensionsEntryPoint(writer, item, version));

            item.ElementExtensions.Add(new ExtensionObject {
                Value = 10
            });
            item.ElementExtensions.Add(new ExtensionObject {
                Value = 11
            });
            CompareHelper.AssertEqualWriteOutput(
                @"<SyndicationItemFormatterTests.ExtensionObject xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""http://schemas.datacontract.org/2004/07/System.ServiceModel.Syndication.Tests"">
    <Value>10</Value>
</SyndicationItemFormatterTests.ExtensionObject>
<SyndicationItemFormatterTests.ExtensionObject xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""http://schemas.datacontract.org/2004/07/System.ServiceModel.Syndication.Tests"">
    <Value>11</Value>
</SyndicationItemFormatterTests.ExtensionObject>", writer => Formatter.WriteElementExtensionsEntryPoint(writer, item, version));
        }