public void EmployeeSalaryService_GetEmployeeSalary_ObjectNotNull_Test() { EmployeeSalaryService employeeSalaryService = new EmployeeSalaryService(); var empSalary = employeeSalaryService.GetEmployeeSalary(); Assert.IsNotNull(empSalary); }
public void EmployeeSalaryService_GetEmployeeSalary_ObjectCount_Test() { EmployeeSalaryService employeeSalaryService = new EmployeeSalaryService(); var empSalary = employeeSalaryService.GetEmployeeSalary(); Assert.IsTrue(empSalary.Count() == 2); }
public void GetEmployees_ReturnsListEmployeesWithSalary() { var service = new EmployeeSalaryService(); var list = service.GetEmployees(); Assert.NotNull(list); Assert.True(list.Any()); Assert.Contains(list, x => x.Salary > 0); }
public MainWindow() { InitializeComponent(); employeeSalaryService = new EmployeeSalaryService(); incomeTaxService = new IncomeTaxService(); GetEmployeeDetails(); EmployeesPayslip = new ObservableCollection <PaySlip>(); PaySlipVisible = Visibility.Collapsed; this.DataContext = this; }
public void SalaryCalculationService_GetSalaryCalculationTest() { EmployeeSalaryService test = new EmployeeSalaryService(); IncomeTaxService test2 = new IncomeTaxService(); var emp = test.GetEmployeeSalary(); foreach (var item in emp) { var taxincome = test2.CalculateTax(item.AnualSalary, 2017); var payslip = test.GetPaySlip(item, taxincome, new SalarySlipPeriod(1, 3)); } System.Diagnostics.Debug.WriteLine("Test"); }
public void EmployeeSalaryService_GetPaySlipTest() { EmployeeSalaryService employeeSalaryService = new EmployeeSalaryService(); var empSalary = employeeSalaryService.GetEmployeeSalary(); PaySlip paySlip = null; foreach (var item in empSalary) { paySlip = employeeSalaryService.GetPaySlip(item, new Model.IncomeTax() { Tax = (922 * 12), Year = 2017 }, new Model.SalarySlipPeriod(1, 3)); break; } Assert.IsNotNull(paySlip); }
public void GetEmployeeSalaryByHourlySalary() { //Given Employee expected = new Employee { id = 1, name = "Camilo Angel", contractTypeName = ContractType.HourlySalaryEmployee, roleId = 1, roleName = "Administrator", roleDescription = "Administrator role", hourlySalary = 20, anualSalary = 28800 }; //When Employee employeeInfo = new Employee { id = 1, name = "Camilo Angel", contractTypeName = ContractType.HourlySalaryEmployee, roleId = 1, roleName = "Administrator", roleDescription = "Administrator role", hourlySalary = 20, }; EmployeeSalaryService employeeSalaryService = new EmployeeSalaryService(); employeeSalaryService.GetEmployeeSalaryByContractType(employeeInfo); //Assert employeeInfo.WithDeepEqual(expected) .SkipDefault <Employee>() .Assert(); }
static void Main(string[] args) { Console.WriteLine("Here a list of the Employees:"); var employeeService = new EmployeeService(); var listEmployees = employeeService.GetEmployees(); foreach (var employee in listEmployees) { Console.WriteLine($"Id = {employee.Id}, First Name = {employee.FirstName}, Last Name = {employee.LastName}"); } Console.WriteLine("Here is the list of Employees with Salary"); var employeeWithSalaryService = new EmployeeSalaryService(); listEmployees = employeeWithSalaryService.GetEmployees(); foreach (var employeeWithSalary in listEmployees) { Console.WriteLine($"Id = {employeeWithSalary.Id}, First Name = {employeeWithSalary.FirstName}, Last Name = {employeeWithSalary.LastName}, Salary = {employeeWithSalary.Salary}"); } Console.WriteLine("End of all employees."); Console.ReadKey(); }