コード例 #1
0
ファイル: Formatter.cs プロジェクト: Liam-Scott-Russell/Katas
        public static string ConcatenatePayPeriod(PayPeriod payPeriod)
        {
            var formattedStartDate = payPeriod.Start.ToString("MMMM dd");
            var formattedEndDate   = payPeriod.End.ToString("MMMM dd");

            return($"{formattedStartDate} - {formattedEndDate}");
        }
コード例 #2
0
        private static Payslip CreatePayslipObject(Employee employee, PayPeriod payPeriod)
        {
            var calculator = new TaxCalculator(employee);

            return(new Payslip()
            {
                Employee = employee,
                PayPeriod = payPeriod,
                TaxInformation = new TaxDetails()
                {
                    GrossIncome = calculator.GetGrossIncome(),
                    IncomeTax = calculator.GetIncomeTax(),
                    NetIncome = calculator.GetNetIncome(),
                    SuperAmount = calculator.GetSuperAmount()
                }
            });
        }
コード例 #3
0
 public static Payslip MakePayslip(Employee employee, PayPeriod payPeriod)
 {
     return(CreatePayslipObject(employee, payPeriod));
 }