/*The gross amount is the result after multiplying HoursWorked and HourRate*/ public void Should_calculate_the_gross_amount_if_employee_has_hourworked_and_hourRate() { var HourWorked = 60; var HourRate = 10; var IrelandEmployee = BuilderEmployee.Create().EarnsForHour(HourRate).WorkedFor(HourWorked).Build(); CalculateSalaryFromIreland calculate = new CalculateSalaryFromIreland(IrelandEmployee); var GrossAmountTemplate = HourRate * HourWorked; Assert.Equal(calculate.GrossAmount, GrossAmountTemplate); }
/*a compulsory pension contribution of 4% is applied*/ public void Should_calculate_the_pension_tax_of_4_percent() { var HourWorked = 60; var HourRate = 10; var IrelandEmployee = BuilderEmployee.Create().EarnsForHour(HourRate).WorkedFor(HourWorked).Build(); CalculateSalaryFromIreland calculate = new CalculateSalaryFromIreland(IrelandEmployee); calculate.CalculatePension(); var PensionAmountTemplate = HourRate * HourWorked * .04; Assert.Equal(calculate.PensionAmount, PensionAmountTemplate); }
/*a Universal social charge of 7% is applied for the first €500 euro and 8% thereafter*/ public void Should_calculate_the_social_contribuation_tax_of_8_percent_if_the_grossamount_is_greater_than_500_euro() { var HourWorked = 51; var HourRate = 10; var IrelandEmployee = BuilderEmployee.Create().EarnsForHour(HourRate).WorkedFor(HourWorked).Build(); CalculateSalaryFromIreland calculate = new CalculateSalaryFromIreland(IrelandEmployee); calculate.CalculateSocialContribution(); var SocialTaxAmountTemplate = HourRate * HourWorked * .08; Assert.Equal(calculate.SocialTaxAmount, SocialTaxAmountTemplate); }
/*income tax at a rate of 25% for the first €600 and 40% thereafter*/ public void Should_calculate_the_tax_rate_of_40_percent_if_the_grossamount_is_greater_than_600_euro() { var HourWorked = 61; var HourRate = 10; var IrelandEmployee = BuilderEmployee.Create().EarnsForHour(HourRate).WorkedFor(HourWorked).Build(); CalculateSalaryFromIreland calculate = new CalculateSalaryFromIreland(IrelandEmployee); calculate.CalculateTaxRate(); var TaxeRateAmountTemplate = HourRate * HourWorked * .40; Assert.Equal(calculate.TaxRateAmount, TaxeRateAmountTemplate); }
/*the net amount value */ public void Should_calculate_the_net_amount() { var HourWorked = 60; var HourRate = 10; var IrelandEmployee = BuilderEmployee.Create().EarnsForHour(HourRate).WorkedFor(HourWorked).Build(); CalculateSalaryFromIreland calculate = new CalculateSalaryFromIreland(IrelandEmployee); calculate.CalculateNetAmount(); var NetAmountTemplate = calculate.GrossAmount - calculate.TaxRateAmount - calculate.SocialTaxAmount - calculate.PensionAmount; Assert.Equal(calculate.NetAmount, NetAmountTemplate); }