public void calculate_bonus_provision() { //Arrange BonusPercentage bonusPercentage = new BonusPercentage(); bonusPercentage.Percentage = 0.05M; Employee employee = new Employee(); employee.Rate = 25000; var data = new MonthlyCost(); data.Employee = employee; //Act var result = data.BonusProvision(bonusPercentage); //Assert Assert.AreEqual(104.17M, result); }
public ActionResult Edit(Employee employee) { try { if (ModelState.IsValid) { _unitOfWork.EmployeeRepository.Update(employee); _unitOfWork.Save(); return RedirectToAction("Index"); } } catch (DataException) { ModelState.AddModelError("", "Unable to save changes. Try again, and if the problem perisit please contact IT"); } PopulateCarGradesDropDownList(employee.CarGradeID); PopulatePensionsDropDownList(employee.PensionID); PopulateBupaRatesDropDownList(employee.BupaRateID); return View(employee); }