public async Task should_only_invoke_public_instance_action() { var httpServer = HttpServerTestHelper.PrepareHttpServer( ControllerAssemblies, new HttpRoute( "ControllerWithNonPublicAction", "Get", HttpMethod.Get, "non-public-action")); using (httpServer) using (var client = new HttpClient(httpServer)) { HttpResponseMessage response = await client.GetAsync( "http://www.base.com/non-public-action"); Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); } }
public async Task should_get_first_matched_route() { HttpServer httpServer = HttpServerTestHelper.PrepareHttpServer( ControllerAssemblies, new HttpRoute( "ControllerWith2DifferentActions", "GetResource1", HttpMethod.Get, "resource"), new HttpRoute( "ControllerWith2DifferentActions", "GetResource2", HttpMethod.Get, "resource")); using (httpServer) using (var client = new HttpClient(httpServer)) { await HttpServerTestHelper.AssertStringContent(client, "http://www.base.com/resource", "get resource 1"); } }