public void Setup()
        {
            FakeEmployeesRepository fakeEmployeesRepository = new FakeEmployeesRepository();

            _createService = new CreateEmployeeService(fakeEmployeesRepository);
            _showService   = new ShowEmployeeService(fakeEmployeesRepository);
        }
 public BuildPaycheckService(
     ShowEmployeeService showEmployeeService,
     BuildPaycheckEntriesRemunarationService buildPaycheckEntriesRemunarationService,
     BuildPaycheckEntriesDiscountService buildPaycheckEntriesDiscountService
     )
 {
     _showEmployeeService = showEmployeeService;
     _buildPaycheckEntriesRemunarationService = buildPaycheckEntriesRemunarationService;
     _buildPaycheckEntriesDiscountService     = buildPaycheckEntriesDiscountService;
 }
Ejemplo n.º 3
0
        public async Task Setup()
        {
            FakeEmployeesRepository fakeEmployeesRepository = new FakeEmployeesRepository();

            Employee employee = new Employee();

            employee.name          = "John";
            employee.lastName      = "Doe";
            employee.document      = "124578";
            employee.grossWage     = 5000;
            employee.admissionDate = new System.DateTime(2019, 11, 06);
            employee.hasHealthPlan = true;
            employee.hasDentalPlan = true;
            employee.hasTransportationVouchersDiscount = true;

            _employee = await fakeEmployeesRepository.Create(employee);

            ShowEmployeeService showEmployeeService = new ShowEmployeeService(fakeEmployeesRepository);

            CalculateINSSDiscountService                  calculateINSSDiscountService                  = new CalculateINSSDiscountService();
            CalculateIRPFDiscountService                  calculateIRPFDiscountService                  = new CalculateIRPFDiscountService();
            CalculateHealthPlanDiscountService            calculateHealthPlanDiscountService            = new CalculateHealthPlanDiscountService();
            CalculateDentalPlanDiscountService            calculateDentalPlanDiscountService            = new CalculateDentalPlanDiscountService();
            CalculateTransportationVoucherDiscountService calculateTransportationVoucherDiscountService = new CalculateTransportationVoucherDiscountService();
            CalculateFGTSDiscountService                  calculateFGTSDiscountService                  = new CalculateFGTSDiscountService();

            _service = new BuildPaycheckService(
                showEmployeeService,
                new BuildPaycheckEntriesRemunarationService(),
                new BuildPaycheckEntriesDiscountService(
                    calculateINSSDiscountService,
                    calculateIRPFDiscountService,
                    calculateHealthPlanDiscountService,
                    calculateDentalPlanDiscountService,
                    calculateTransportationVoucherDiscountService,
                    calculateFGTSDiscountService
                    )
                );
        }
Ejemplo n.º 4
0
 public async Task <ActionResult <Employee> > GetByID(
     [FromServices] ShowEmployeeService service,
     Guid id)
 {
     return(await service.execute(id));
 }