Esempio n. 1
0
        public void NullAction()
        {
            var userType = typeof(string);
            var roleType = typeof(string);
            var services = new ServiceCollection();
            var builder  = new IdentityBuilder(userType, roleType, services);

            var authenticatorServiceOptions = new AuthenticatorServiceOptions();

            Assert.Throws <ArgumentNullException>(() => builder.AddAuthenticator((Action <AuthenticatorServiceOptions>)null));
        }
Esempio n. 2
0
        public void Success()
        {
            var userType = typeof(string);
            var roleType = typeof(string);
            var services = new ServiceCollection();
            var builder  = new IdentityBuilder(userType, roleType, services);

            var userManagerType = typeof(UserManager <string>);

            services.AddScoped(userManagerType);

            var authenticatorServiceOptions = new AuthenticatorServiceOptions();

            var actualBuilder = builder.AddAuthenticator(authenticatorServiceOptions);

            AddAuthenticatorTest(builder, actualBuilder, services);
        }
Esempio n. 3
0
 public static IdentityBuilder AddAuthenticator(this IdentityBuilder builder, AuthenticatorServiceOptions configureOptions)
 {
     builder.Services.AddAuthenticator(configureOptions);
     builder.AddAuthenticator();
     return(builder);
 }