public void WhenConvertingToContentPassingASerializerThenTheSerializerIsInvoked() { var serializer = new MockXmlSerializer(typeof(Customer)); var customer = new Customer { CustomerID = 1 }; var content = customer.ToContentUsingXmlSerializer(serializer); }
[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); }