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

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

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

            AssertExtensions.Throws <ArgumentNullException>("writer", () => document.WriteAttributeExtensionsEntryPoint(null, "version"));
        }