Beispiel #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));
        }
Beispiel #2
0
        public void SuccessAction()
        {
            var userType = typeof(string);
            var roleType = typeof(string);
            var services = new ServiceCollection();
            var builder  = new IdentityBuilder(userType, roleType, services);

            services.AddScoped(typeof(UserManager <string>));

            var actualBuilder = builder.AddAuthenticator(c => { });

            AddAuthenticatorTest(builder, actualBuilder, services);
        }
Beispiel #3
0
 public static IdentityBuilder AddAuthenticator(this IdentityBuilder builder, Action <AuthenticatorServiceOptions> configuration)
 {
     builder.Services.AddAuthenticator(configuration);
     builder.AddAuthenticator();
     return(builder);
 }