Exemplo n.º 1
0
        // employee listing screen
        public async Task <IActionResult> Listing()
        {
            // check auth
            if (!await CheckAccess())
            {
                return(Redirect("/"));
            }

            var emplList = await EmployeePaymentService.GetAllEmployees();

            var stateList = SeedingHelpers.StatesGenerator.List;
            var model     = new core.Models.LisitngModels.ViewModel
            {
                EmplList = emplList.Select(x => new GenericModels.DropdownListItem
                {
                    Value = x.Id.ToString(),
                    Text  = $"{x.FirstName} {x.LastName}"
                }),
                StatesList = stateList.Select(x => new GenericModels.DropdownListItem
                {
                    Value = x.Abbreviation,
                    Text  = $"{x.Name}"
                })
            };

            return(View(model));
        }
Exemplo n.º 2
0
        public void Star_Employee_Salary_Calculation()
        {
            var employee = new StarEmployee();

            employee.TotalOfSales = 500;
            employee.Salary       = 10000;

            EmployeePaymentService paymentService = new EmployeePaymentService();
            var result = paymentService.GetNetSalary(employee);

            Assert.AreEqual(10050, result);
        }
Exemplo n.º 3
0
        public void Normal_Employee_Salary_Calculation()
        {
            var employee = new NormalEmployee();

            employee.TotalOfSales = 200;
            employee.Salary       = 5000;

            EmployeePaymentService paymentService = new EmployeePaymentService();
            var result = paymentService.GetNetSalary(employee);

            Assert.AreEqual(5004, result);
        }