Пример #1
0
        public void Setup()
        {
            _userManager = Substitute.For <UserManager <User> >(Substitute.For <IUserStore <User> >(),
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                null,
                                                                null);

            _signInManager = Substitute.For <SignInManager <User> >(_userManager,
                                                                    Substitute.For <IHttpContextAccessor>(),
                                                                    Substitute.For <IUserClaimsPrincipalFactory <User> >(),
                                                                    null,
                                                                    null,
                                                                    null,
                                                                    null);

            _mapper     = Substitute.For <IStorageUserModelMapper>();
            _repository = Substitute.For <IUsersRepository>();
            _usersApi   = new UsersApi(_userManager,
                                       _signInManager,
                                       _mapper,
                                       _repository);
        }
Пример #2
0
 public UsersApi(UserManager <Storage.User> userManager,
                 SignInManager <Storage.User> signInManager,
                 IStorageUserModelMapper mapper,
                 IUsersRepository repository)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _mapper        = mapper;
     _repository    = repository;
 }