public void PostingJson_GetRequestValueAccessor_ConvertsJsonObjects_ToString() { var ctx = new FakeHttpContext(); ctx.request.CreatePost("/", "application/json", "{ hello: 'world', one: 1 }"); var accessor = ctx.GetRequestValueAccessor(); accessor("one").ShouldBe("1"); }
public void PostingJson_GetRequestValueAccessor_UsesJsonAsSource() { var ctx = new FakeHttpContext(); ctx.request.CreatePost("/", "application/json", "{ hello: 'world' }"); var accessor = ctx.GetRequestValueAccessor(); accessor("hello").ShouldBe("world"); }