public void WhenASOAPEnvelopeWithAHeaderBlockFromAnObjectWithNoXMLAttributeIsBuilt() { var obj = new XmlObjectWithNoAttribute { 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> <XmlObjectWithNoAttribute> <MyProperty>2</MyProperty> </XmlObjectWithNoAttribute> </env:Header> </env:Envelope>"; this.xmlTester.ArrangeExpectedXml(expectedXml); }
public void WhenASOAPEnvelopeWithABodyEntryFromAnObjectWithNoXMLAttributeIsBuilt() { var obj = new XmlObjectWithNoAttribute { 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> <XmlObjectWithNoAttribute> <MyProperty>2</MyProperty> </XmlObjectWithNoAttribute> </env:Body> </env:Envelope>"; this.xmlTester.ArrangeExpectedXml(expectedXml); }