public void ShouldRetrieveFormDataFromApplicationContextBasedOnKey() { var strategy = new ApplicationStateVariablesFormDataStrategy(Key, ExampleMediaType.ContentType); var content = strategy.CreateFormData(new HttpResponseMessage(), StateVariables, ClientCapabilities); Assert.AreEqual(DummyResponse.EntityBody.Id, content.ReadAsObject<ExampleEntityBody>(ExampleMediaType.Instance).Id); }
public void ShouldAddContentTypeHeaderToContent() { var strategy = new ApplicationStateVariablesFormDataStrategy(Key, ExampleMediaType.ContentType); var content = strategy.CreateFormData(new HttpResponseMessage(), StateVariables, ClientCapabilities); Assert.AreEqual(ExampleMediaType.ContentType, content.Headers.ContentType); }