public EmployeeProfileRepository(
     SalaryCalculatorDbContext dbContext,
     ILogger <EmployeeProfileRepository> logger)
 {
     _dbContext = dbContext;
     _logger    = logger;
 }
 public SalaryConfigRepository(
     SalaryCalculatorDbContext dbContext,
     ILogger <SalaryConfigRepository> logger)
 {
     _dbContext = dbContext;
     _logger    = logger;
 }
Beispiel #3
0
        public void DbContext_ShouldHave_DbSetPropertyEmployees()
        {
            ISalaryCalculatorDbContext dbContext = SalaryCalculatorDbContext.Create();

            var dbSetEmployees = dbContext.Set <FakeEmployee>();

            Assert.IsInstanceOf(typeof(DbSet <Employee>), dbSetEmployees);
        }
Beispiel #4
0
        public void ConstructorWhenPassed_ShouldCreateInstance()
        {
            // Arrange & Act
            var dbContext = new SalaryCalculatorDbContext();

            // Assert
            Assert.IsInstanceOf(typeof(IdentityDbContext <User>), dbContext);
        }
        public void DbContext_ShouldCreateInstance_WhenCreateMethodIsInvoked()
        {
            // Arrange & Act
            ISalaryCalculatorDbContext dbContext = SalaryCalculatorDbContext.Create();

            // Assert
            Assert.IsInstanceOf(typeof(IdentityDbContext <User>), dbContext);
        }
Beispiel #6
0
 public EmployeeMonthlyEnteredRecordRepository(
     SalaryCalculatorDbContext dbContext,
     ILogger <EmployeeMonthlyEnteredRecordRepository> logger,
     IDataProtectionProvider dataProtectionProvider
     )
 {
     _dbContext = dbContext;
     _logger    = logger;
     _dataProtectionProvider = dataProtectionProvider;
 }
Beispiel #7
0
        public void CreateInstance_WhenAllParametersArePassedCorrectly()
        {
            // Arrange
            ISalaryCalculatorDbContext dbContext = new SalaryCalculatorDbContext();

            IRepository <User>             userRepo     = new SalaryCalculatorRepository <User>(dbContext);
            IRepository <EmployeePaycheck> paycheckRepo = new SalaryCalculatorRepository <EmployeePaycheck>(dbContext);
            IRepository <RemunerationBill> billRepo     = new SalaryCalculatorRepository <RemunerationBill>(dbContext);
            IRepository <SelfEmployment>   selfRepo     = new SalaryCalculatorRepository <SelfEmployment>(dbContext);

            ICacheService            cacheService          = new HttpCacheService();
            IUserService             userService           = new UserService(userRepo);
            IEmployeePaycheckService paycheckService       = new EmployeePaycheckService(paycheckRepo);
            IRemunerationBillService billService           = new RemunerationBillService(billRepo);
            ISelfEmploymentService   selfEmploymentService = new SelfEmploymentService(selfRepo);

            // Act & Assert
            Assert.IsInstanceOf <HomeController>(new HomeController(cacheService, userService, paycheckService, billService, selfEmploymentService));
        }
Beispiel #8
0
 public static void Initialize()
 {
     Database.SetInitializer(new MigrateDatabaseToLatestVersion <SalaryCalculatorDbContext, Configuration>());
     SalaryCalculatorDbContext.Create().Database.Initialize(true);
 }
 public SatisfactoryScoreRepository(SalaryCalculatorDbContext dbContext)
 {
     _dbContext = dbContext;
 }
 public EmployeeRepository(SalaryCalculatorDbContext dbContext)
 {
     _dbContext = dbContext;
 }