コード例 #1
0
        public void WhenASOAPEnvelopeWithAHeaderBlockFromAnObjectWithAnXMLTypeAttributeIsBuilt()
        {
            var obj = new XmlObjectWithTypeAttribute
            {
                MyProperty = 2
            };

            this.soapEnvelope = SoapBuilder.CreateSoap12Envelope()
                                .WithHeader.AddBlock(obj)
                                .Build()
                                .ToString();

            this.xmlTester.ArrangeActualXml(this.soapEnvelope);

            const string expectedXml =
                @"<env:Envelope xmlns:env=""http://www.w3.org/2003/05/soap-envelope"">
  <env:Header>
    <XmlObjectWithTypeAttribute xmlns=""http://type.attribute"">
        <MyProperty>2</MyProperty>
    </XmlObjectWithTypeAttribute>
  </env:Header>
</env:Envelope>";

            this.xmlTester.ArrangeExpectedXml(expectedXml);
        }
コード例 #2
0
        public void WhenASOAPEnvelopeWithABodyEntryFromAnObjectWithAnXMLTypeAttributeIsBuilt()
        {
            var obj = new XmlObjectWithTypeAttribute
            {
                MyProperty = 2
            };

            this.soapEnvelope = SoapBuilder.CreateSoap11Envelope()
                                .WithBody.AddEntry(obj)
                                .Build()
                                .ToString();

            this.xmlTester.ArrangeActualXml(this.soapEnvelope);

            var expectedXml =
                @"<env:Envelope xmlns:env=""http://schemas.xmlsoap.org/soap/envelope/"">
  <env:Body>
    <XmlObjectWithTypeAttribute xmlns=""http://type.attribute"">
        <MyProperty>2</MyProperty>
    </XmlObjectWithTypeAttribute>
  </env:Body>
</env:Envelope>";

            this.xmlTester.ArrangeExpectedXml(expectedXml);
        }