public void ItCanReturnQuoteForm() { var mRequest = new MockRequest() {Method = "GET", Resource = "/", Route="GET /"}; var route = new Route("GET", "/", new QuoteFormResponse()); var routes = new Router(); routes.AddRoute(route); var responseString = routes.GetResponse(mRequest).ToString(); var expectedResponseString = (new QuoteFormResponse()).Construct(mRequest).ToString(); responseString.ShouldEqual(expectedResponseString); }
public void ItCanReturnA404() { var mRequest = new MockRequest {Method = "foo", Resource = "bar", Route="foo /bar"}; var router = new Router(); router.GetResponse(mRequest).StatusCode.ShouldEqual(404); }