public IServiceCollection AddLambdaServices(IConfigurationRoot configuration) { var services = new ServiceCollection(); var applicationAssembly = new AssemblyApplication().GetAssembly(); services.AddMediatR(applicationAssembly); return(services); }
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); }