コード例 #1
0
        public void WriteAttributeExtensions_Invoke_ReturnsExpected(string version)
        {
            var collectionInfo = new ResourceCollectionInfoSubclass();

            CompareHelper.AssertEqualWriteOutput("", writer => collectionInfo.WriteAttributeExtensionsEntryPoint(writer, version));

            collectionInfo.AttributeExtensions.Add(new XmlQualifiedName("name1"), "value");
            collectionInfo.AttributeExtensions.Add(new XmlQualifiedName("name2", "namespace"), "");
            collectionInfo.AttributeExtensions.Add(new XmlQualifiedName("name3"), null);
            CompareHelper.AssertEqualWriteOutput(@"name1=""value"" d0p1:name2="""" name3=""""", writer => collectionInfo.WriteAttributeExtensionsEntryPoint(writer, "version"));
        }
コード例 #2
0
        public void CreateReferencedCategoriesDocument_Invoke_ReturnsExpected()
        {
            var workspace = new ResourceCollectionInfoSubclass();
            ReferencedCategoriesDocument document = workspace.CreateReferencedCategoriesDocumentEntryPoint();

            Assert.Empty(document.AttributeExtensions);
            Assert.Null(document.BaseUri);
            Assert.Empty(document.ElementExtensions);
            Assert.Null(document.Language);
            Assert.Null(document.Link);
        }
コード例 #3
0
        public void CreateInlineCategoriesDocument_Invoke_ReturnsExpected()
        {
            var workspace = new ResourceCollectionInfoSubclass();
            InlineCategoriesDocument document = workspace.CreateInlineCategoriesDocumentEntryPoint();

            Assert.Empty(document.AttributeExtensions);
            Assert.Null(document.BaseUri);
            Assert.Empty(document.Categories);
            Assert.Empty(document.ElementExtensions);
            Assert.False(document.IsFixed);
            Assert.Null(document.Language);
            Assert.Null(document.Scheme);
        }
コード例 #4
0
        public void WriteElementExtensions_Invoke_ReturnsExpected(string version)
        {
            var collectionInfo = new ResourceCollectionInfoSubclass();

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

            collectionInfo.ElementExtensions.Add(new ExtensionObject {
                Value = 10
            });
            collectionInfo.ElementExtensions.Add(new ExtensionObject {
                Value = 11
            });
            CompareHelper.AssertEqualWriteOutput(
                @"<ResourceCollectionInfoTests.ExtensionObject xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""http://schemas.datacontract.org/2004/07/System.ServiceModel.Syndication.Tests"">
    <Value>10</Value>
</ResourceCollectionInfoTests.ExtensionObject>
<ResourceCollectionInfoTests.ExtensionObject xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""http://schemas.datacontract.org/2004/07/System.ServiceModel.Syndication.Tests"">
    <Value>11</Value>
</ResourceCollectionInfoTests.ExtensionObject>", writer => collectionInfo.WriteElementExtensionsEntryPoint(writer, version));
        }
コード例 #5
0
        public void WriteElementExtensions_NullWriter_ThrowsArgumentNullException()
        {
            var collectionInfo = new ResourceCollectionInfoSubclass();

            AssertExtensions.Throws <ArgumentNullException>("writer", () => collectionInfo.WriteElementExtensionsEntryPoint(null, "version"));
        }
コード例 #6
0
        public void TryParseElement_Invoke_ReturnsFalse(XmlReader reader, string version)
        {
            var collectionInfo = new ResourceCollectionInfoSubclass();

            Assert.False(collectionInfo.TryParseElementEntryPoint(reader, version));
        }
コード例 #7
0
        public void TryParseAttribute_Invoke_ReturnsFalse(string name, string ns, string value, string version)
        {
            var collectionInfo = new ResourceCollectionInfoSubclass();

            Assert.False(collectionInfo.TryParseAttributeEntryPoint(name, ns, value, version));
        }