private static RouteContext GetRouteContext(Action <RouteSpecBuilder> configure) { var builder = new RouteSpecBuilder(); configure(builder); var spec = builder.Build(); return(RouteContextBuilder.FromUrl("/").WithSpec(spec).Build()); }
public void CanTakeTargetAddressFromSpec() { var spec = new RouteSpecBuilder().WithServer("http://test").Build(); var ctx = RouteContextBuilder.FromUrl("/").WithSpec(spec).Build(); var expected = new ResponseContext { StatusCode = HttpStatusCode.OK, Body = "", ContentType = "application/json; charset=utf-8", Headers = { { "Content-Type", "application/json; charset=utf-8" } } }; var actual = Sut(null).HandleAsync(ctx).Result?.RemoveSystemHeader(); DeepAssert.Equal(expected, actual); }