public UserServiceTest() { var passwordHelperLocalizer = Substitute.For<IStringLocalizer<PasswordHelper>>(); passwordHelperLocalizer[Arg.Any<string>()].Returns(p => new LocalizedString((string)p[0], (string)p[0])); _passwordHelper = new PasswordHelper(passwordHelperLocalizer); _totpService = new TimeBasedOneTimePasswordNuGetService(); var dataHelper = new DataHelper(); _db = dataHelper.CreateDbContext(_passwordHelper); _factory = dataHelper.Factory; _service = new UserService(_db, _totpService); }
public UserService(DataContext context, ITimeBasedOneTimePasswordService totpService) { _context = context; _totpSerivce = totpService; }