public void Sprawdzenie_Kalkulatora_dla_kilku_wariantow_wynagrodzenia (decimal _salary, SalaryFrom _salaryFrom, decimal ExceptetResult) { //Arrange var contract = new ContractBuilder() .TypeOfContract(TypeOfContract.UmowaODzielo) .Salary(_salary, _salaryFrom) .HigherCostOfGettingIncome(false) .Build(); //Act var calculator = new SalaryCalculator(contract); var result = calculator.Calculator(); //Assert if (_salaryFrom == SalaryFrom.Gross) { Assert.Equal(ExceptetResult, result.NetSalary); } if (_salaryFrom == SalaryFrom.Net) { Assert.Equal(ExceptetResult, result.GrossSalary); } }
public ContractBuilder Salary(decimal salary, SalaryFrom salaryFrom) { result.Salary = salary; result.SalaryFrom = salaryFrom; return(this); }