public void get_returns_expected_response_when_nothing_has_been_registered() { var sut = new EngineBuilder().Build(); var response = sut.GetResponseFor(ResourceRequest.Get("/foo")); Assert.Equal( expected: ResourceResponse.NotFound(), actual: response, comparer: new StatusCodeComparer() ); }
public void get_single_returns_expected_response_when_nothing_was_found() { var sut = new EngineBuilder().Build(); sut.RegisterHandler(new HandlerDefinition { HttpVerb = HttpVerbs.Get, ResourceName = "foo", Handler = request => HandlerResult.Nothing() }); var response = sut.GetResponseFor(ResourceRequest.Get("/foo/1")); Assert.Equal( expected: ResourceResponse.NotFound(), actual: response, comparer: new StatusCodeComparer() ); }