Exemplo n.º 1
0
        public UsersServiceTests()
        {
            _userManagerMock = IdentityMocksProvider.GetMockUserManager();
            _jwtFactoryMock  = new Mock <IJwtFactory>();
            _mapperMock      = new Mock <IMapper>();

            _usersService = new UsersService(
                _userManagerMock.Object,
                _jwtFactoryMock.Object,
                _mapperMock.Object);
        }
Exemplo n.º 2
0
        public UsersServiceTests()
        {
            _dbContext         = GetInMemoryDbContext();
            _userManagerMock   = IdentityMocksProvider.GetMockUserManager();
            _mapperMock        = new Mock <IMapper>();
            _signInManagerMock = IdentityMocksProvider.GetMockSignInManager();
            _cartServiceMock   = new Mock <IShoppingCartService>();

            _usersService = new UsersService(
                GetInMemoryDbContext(),
                _userManagerMock.Object,
                _signInManagerMock.Object,
                _mapperMock.Object,
                _cartServiceMock.Object);
        }
Exemplo n.º 3
0
        public OnboardingServiceTests()
        {
            _csvReportGenerator = new CsvReportGenerator();

            _agenciesService = new AgenciesService(
                CreateMapper(),
                DbContextProvider.GetSqlServerDbContext());

            _venuesService = new VenuesService(
                CreateMapper(),
                DbContextProvider.GetSqlServerDbContext());

            _userManagerMock = IdentityMocksProvider.GetMockUserManager();

            var fixture = new Fixture();

            var signingKey = new SymmetricSecurityKey(Encoding.Default.GetBytes(fixture.Create <string>()));

            _jwtConfiguration = fixture
                                .Build <JwtConfiguration>()
                                .With(config => config.SigningCredentials, new SigningCredentials(signingKey, SecurityAlgorithms.HmacSha256))
                                .Create();

            var jwtFactory = new JwtFactory(CreateJwtFactoryConfiguration());

            _usersService = new UsersService(
                _userManagerMock.Object,
                jwtFactory,
                CreateMapper());

            _peopleService = new PeopleService(
                CreateMapper(),
                DbContextProvider.GetSqlServerDbContext(),
                _usersService);

            _weddingsService = new WeddingsService(
                CreateMapper(),
                DbContextProvider.GetSqlServerDbContext());

            _onboardingService = new OnboardingService(
                CreateMapper(),
                DbContextProvider.GetSqlServerDbContext(),
                _agenciesService,
                _csvReportGenerator,
                _venuesService,
                _peopleService,
                _weddingsService);
        }
        public UsersServiceTests()
        {
            _userManagerMock    = IdentityMocksProvider.GetMockUserManager();
            _jwtFactoryMock     = new Mock <IJwtFactory>();
            _mapperMock         = new Mock <IMapper>();
            _companyServiceMock = new Mock <ICompanyService>();
            _dbContextMock      = new Mock <ApplicationDbContext>();
            _teamService        = new Mock <ITeamService>();
            _teamUserService    = new Mock <ITeamUserService>();

            _usersService = new UsersService(
                _userManagerMock.Object,
                _jwtFactoryMock.Object,
                _mapperMock.Object,
                _companyServiceMock.Object,
                _dbContextMock.Object,
                _teamService.Object,
                _teamUserService.Object);
        }