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"); }
public void SetUp() { externalRepository = ExternalContentRepositoryTests.SetupRepository(out root, out start); var rd = new RouteData(); rd.Values["controller"] = "stub"; rd.Values["action"] = "index"; var engine = MockRepository.GenerateStub<IEngine>(); engine.Stub(e => e.Resolve<IExternalContentRepository>()).Return(externalRepository); rd.DataTokens[ContentRoute.ContentEngineKey] = engine; context = new FakeHttpContext(); rc = new RequestContext(context, rd); }
public FakeWebContextWrapper(string currentUrl) { Url = currentUrl; httpContext = new FakeHttpContext(currentUrl); }
public FakeWebContextWrapper(FakeHttpContext httpContext) { this.httpContext = httpContext; }
public FakeWebContextWrapper(string currentUrl) { Url = currentUrl; httpContext = new FakeHttpContext(currentUrl); }
public FakeWebContextWrapper(FakeHttpContext httpContext) { this.httpContext = httpContext; }