Пример #1
0
        public CityService(IRepositoryEf <City> cityRepo, Func <IUnitOfWorkEF> unitOfWork)
            : base(unitOfWork)
        {
            Guard.WhenArgument(cityRepo, nameof(cityRepo)).IsNull().Throw();

            this.cityRepo = cityRepo;
        }
Пример #2
0
 public QuizGameAPIController(IRepositoryEf <Quiz> quizRepo,
                              QuizAppDbContext dbContext, ILogger <QuizGameAPIController> logger)
 {
     _quizRepo  = quizRepo;
     _dbContext = dbContext;
     _logger    = logger;
 }
Пример #3
0
        public void Throw_ArgumentNullException_WithMessagContaining_CityRepo_WhenCityRepoIsNull()
        {
            // Arrange
            var mockedUOW = new Mock <IUnitOfWorkEF>();
            IRepositoryEf <City> cityRepo = null;

            // Act & Assert
            Assert.That(() => new CityService(cityRepo, () => mockedUOW.Object),
                        Throws.ArgumentNullException.With.Message.Contain(nameof(cityRepo)));
        }
Пример #4
0
        public AccountManagementService(
            IRepositoryEf <Car> carsRepo,
            IProjectableRepositoryEf <User> userRepo,
            Func <IUnitOfWorkEF> unitOfWork)
            : base(unitOfWork)
        {
            Guard.WhenArgument(carsRepo, nameof(carsRepo)).IsNull().Throw();
            Guard.WhenArgument(userRepo, nameof(userRepo)).IsNull().Throw();

            this.carsRepo = carsRepo;
            this.userRepo = userRepo;
        }
Пример #5
0
        public AuthService(IOwinContext owinContext, Func <IUnitOfWorkEF> unitOfWork, IRepositoryEf <User> userRepo)
        {
            Guard.WhenArgument(owinContext, nameof(owinContext)).IsNull().Throw();
            Guard.WhenArgument(unitOfWork, nameof(unitOfWork)).IsNull().Throw();
            Guard.WhenArgument(userRepo, nameof(userRepo)).IsNull().Throw();

            this.unitOfWork = unitOfWork;
            this.userRepo   = userRepo;

            this.signInManager = owinContext.Get <ApplicationSignInManager>();
            this.userManager   = owinContext.Get <ApplicationUserManager>();
            this.authManager   = owinContext.Authentication;

            this.userManager.UserLockoutEnabledByDefault = true;
        }
Пример #6
0
 public GameController(IRepositoryEf <Quiz> quizRepo)
 {
     _quizRepo = quizRepo;
 }
Пример #7
0
 public AnswerController(IRepositoryEf <Answer> answerRepo, ILogger <AnswerController> logger, QuizAppDbContext dbContext)
 {
     _dbContext  = dbContext;
     _answerRepo = answerRepo;
     _logger     = logger;
 }
Пример #8
0
 public QuestionController(IRepositoryEf <Question> questionRepo, ILogger <QuestionController> logger)
 {
     _questionRepo = questionRepo;
     _logger       = logger;
 }