Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using WNPayroll.TaxCalcs;
- using WNPayroll.Zenith.Models.Data.Payroll;
- using Xunit;
- using Zenith.Business.Engine;
- using Zenith.Models.Data.Payroll.PayData;
- using SubTaxType = WNPayroll.Zenith.Models.Data.Enums.SubTaxType;
- namespace Zenith.UnitTests.Test_Cases
- {
- public class StatutoryTaxingTests
- {
- private readonly PayrollEngineV2 Engine = new PayrollEngineV2();
- private ZenithPayrollData PD = new ZenithPayrollData();
- private readonly Boolean W42020Tests = false;
- private readonly States StateTested = States.CA;
- /* Monthly = 1
- * Semi-weekly = 2 */
- private readonly short Default_FederalTaxDueFrequency = 1;
- [Fact]
- public void P51()
- {
- PD = TestDefaults.ResetPayrollData(StateTested);
- PD.Employees[0].PayDataRecords[0] = TestDefaults.DefaultRecord(25, 40);
- PD.Employees[0].FederalTaxes[0] = new EmployeeFederalTax()
- {
- TaxID = 1,
- FilingStatus = (short)FederalTaxCalcs.FilingStatus.Single,
- Allowances = 0,
- AdditionalWithholding = 0,
- SubTaxType = SubTaxType.FederalTax,
- CompanyTaxDueFrequency = Default_FederalTaxDueFrequency,
- SUTAState = StateTested,
- IsW42020OrLater = W42020Tests,
- };
- PD.Employees[0].FederalTaxes.Add(new EmployeeFederalTax()
- {
- TaxID = 2,
- SubTaxType = SubTaxType.SocialSecurity,
- Exempt=true,
- SUTAState = StateTested,
- CompanyTaxDueFrequency = Default_FederalTaxDueFrequency,
- });
- var results = Engine.Process(PD);
- Assert.Equal(1000m, results.First().GrossPay, 0);
- Assert.Equal(62m, results.First().PayrollTaxes.Find(x => x.TaxID == 2).CompanyAmount, 0);
- }
- [Fact]
- public void P52()
- {
- PD = TestDefaults.ResetPayrollData(StateTested);
- PD.Employees[0].PayDataRecords[0] = TestDefaults.DefaultRecord(25, 40);
- PD.Employees[0].FederalTaxes[0] = new EmployeeFederalTax()
- {
- TaxID = 1,
- FilingStatus = (short)FederalTaxCalcs.FilingStatus.Single,
- Allowances = 0,
- AdditionalWithholding = 0,
- SubTaxType = SubTaxType.FederalTax,
- CompanyTaxDueFrequency = Default_FederalTaxDueFrequency,
- SUTAState = StateTested,
- IsW42020OrLater = W42020Tests,
- };
- PD.Employees[0].FederalTaxes.Add(new EmployeeFederalTax()
- {
- TaxID = 2,
- SubTaxType = SubTaxType.Medicare,
- Exempt = true,
- SUTAState = StateTested,
- CompanyTaxDueFrequency = Default_FederalTaxDueFrequency,
- });
- var results = Engine.Process(PD);
- Assert.Equal(1000m, results.First().GrossPay, 0);
- Assert.Equal(14.5m, results.First().PayrollTaxes.Find(x => x.TaxID == 2).CompanyAmount, 0);
- }
- }
- }
Add Comment
Please, Sign In to add comment