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)); }
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); }
public static IdentityBuilder AddAuthenticator(this IdentityBuilder builder, AuthenticatorServiceOptions configureOptions) { builder.Services.AddAuthenticator(configureOptions); builder.AddAuthenticator(); return(builder); }