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