Exemplo n.º 1
0
        public IServiceCollection AddLambdaServices(IConfigurationRoot configuration)
        {
            var services            = new ServiceCollection();
            var applicationAssembly = new AssemblyApplication().GetAssembly();

            services.AddMediatR(applicationAssembly);

            return(services);
        }
Exemplo n.º 2
0
        public void TetGetMethod()
        {
            var services            = new ServiceCollection();
            var applicationAssembly = new AssemblyApplication().GetAssembly();

            services.AddMediatR(applicationAssembly);

            Functions functions = new Functions(services);

            var request = new APIGatewayProxyRequest()
            {
                Body       = "{\"UserId\":1}",
                HttpMethod = "GET",
                Path       = "/"
            };

            var context = new TestLambdaContext();

            var response = functions.Get(request, context).GetAwaiter().GetResult();

            Assert.NotNull(response);
        }