protected override void ConfigureWebHost(IWebHostBuilder builder)
        {
            var mockAmazonCognitoIdentityProvider = new Mock <IAmazonCognitoIdentityProvider>();

            mockAmazonCognitoIdentityProvider
            .Setup(p => p.AdminCreateUserAsync(It.IsAny <AdminCreateUserRequest>(), It.IsAny <CancellationToken>()))
            .ReturnsAsync(new AdminCreateUserResponse {
                User = new UserType {
                    Username = "******"
                }
            });

            builder.ConfigureTestServices(services =>
            {
                services.AddScoped(provider => mockAmazonCognitoIdentityProvider.Object);

                ConfigurationHelpers.ConfigureExternalServices(services);
            });
        }
Exemplo n.º 2
0
            protected override void ConfigureExternalServices(IServiceCollection services)
            {
                services.AddScoped(provider => Mock.Of <IAmazonCognitoIdentityProvider>());

                ConfigurationHelpers.ConfigureExternalServices(services);
            }