Exemplo n.º 1
0
 public void Configure(IApplicationBuilder app)
 {
     app.UseAuthentication();
     app.Use(_ => async context => {
         var requestContext = new CaberRequestContext {
             HttpContext = context
         };
         requestContext.RouteData = router.Route(requestContext);
         await handler.HandleAsync(requestContext);
     });
 }
Exemplo n.º 2
0
        public void MatchesRegisterRoute()
        {
            var httpContext = new DefaultHttpContext
            {
                Request = { Path = $"/register/{clientId}" }
            };
            var requestContext = new CaberRequestContext {
                HttpContext = httpContext
            };
            var routeData = router.Route(requestContext);

            Assert.That(routeData.Route, Is.InstanceOf <RegisterRoute>());
            Assert.That(routeData.Parameters, Does.Contain(RouteValue("client-uuid", clientId)));
        }