public void Setup()
        {
            var _userStore = Mock.Of <IUserStore <User> >();

            _userManagerMock = new Mock <UserManager <User> >(_userStore, null, null, null, null, null, null, null, null);

            var authenticateServiceSettings = new AuthenticateServiceSettings {
                Secret = Guid.NewGuid().ToString()
            };
            var optionsAuthenticateServiceSettings = Options.Create(authenticateServiceSettings);

            var serviceCollection = new ServiceCollection()
                                    .AddTransient(provider => new AuthenticateService(optionsAuthenticateServiceSettings, _userManagerMock.Object));

            _serviceProvider = serviceCollection.BuildServiceProvider();
        }
Example #2
0
 public AuthenticateService(IOptions <AuthenticateServiceSettings> settings, UserManager <User> userManager)
 {
     this._settings    = settings.Value;
     this._userManager = userManager;
 }