public void WhenConvertingToDataContractAndPassingASerializerThenTheSerializerIsInvoked() { var surrogate = new FakeDataContractSurrogate(); var serializer = GetSerializerUsingSurrogate(surrogate); var content = new StringContent(CustomerXml); var customer = content.ReadAsDataContract<Customer>(serializer); }
public void WhenConvertingToDataContractThenInstanceIsReturned() { var content = new StringContent(CustomerXml); var customer = content.ReadAsDataContract<Customer>(); Assert.AreEqual(1, customer.CustomerID); }