public CityService(IRepositoryEf <City> cityRepo, Func <IUnitOfWorkEF> unitOfWork) : base(unitOfWork) { Guard.WhenArgument(cityRepo, nameof(cityRepo)).IsNull().Throw(); this.cityRepo = cityRepo; }
public QuizGameAPIController(IRepositoryEf <Quiz> quizRepo, QuizAppDbContext dbContext, ILogger <QuizGameAPIController> logger) { _quizRepo = quizRepo; _dbContext = dbContext; _logger = logger; }
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))); }
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; }
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; }
public GameController(IRepositoryEf <Quiz> quizRepo) { _quizRepo = quizRepo; }
public AnswerController(IRepositoryEf <Answer> answerRepo, ILogger <AnswerController> logger, QuizAppDbContext dbContext) { _dbContext = dbContext; _answerRepo = answerRepo; _logger = logger; }
public QuestionController(IRepositoryEf <Question> questionRepo, ILogger <QuestionController> logger) { _questionRepo = questionRepo; _logger = logger; }