Esempio n. 1
0
 public void WhenConvertingToContentPassingASerializerThenTheSerializerIsInvoked()
 {
     var serializer = new MockXmlSerializer(typeof(Customer));
     var customer   = new Customer {
         CustomerID = 1
     };
     var content = customer.ToContentUsingXmlSerializer(serializer);
 }
Esempio n. 2
0
 [ExpectedException(typeof(InvalidOperationException))] //fake is just a stub which throws an exception...hacky but works
 public void WhenConvertingToDataContractAndPassingASerializerThenTheSerializerIsInvoked()
 {
     var serializer = new MockXmlSerializer(typeof(Customer));
     var content    = new StringContent(CustomerXml);
     var customer   = content.ReadAsXmlSerializable <Customer>(serializer);
 }