Beispiel #1
0
        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");
        }
Beispiel #2
0
        public void PostingJson_GetRequestValueAccessor_UsesJsonAsSource()
        {
            var ctx = new FakeHttpContext();

            ctx.request.CreatePost("/", "application/json", "{ hello: 'world' }");

            var accessor = ctx.GetRequestValueAccessor();

            accessor("hello").ShouldBe("world");
        }