You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
REQUIRE(incomeSalaries.calculateIncomeUnderHeadSalaries() == Catch::Approx(2246000 - deductions.calculateTotalDeductions())); // Adjust the expected value as needed
1067
+
1068
+
// Test with modified salary values
1069
+
salary.basicSalary = 1000000;
1070
+
salary.pension = 0;
1071
+
salary.dearnessAllowance = 0;
1072
+
salary.bonusCommissions = 0;
1073
+
salary.advanceSalary = 0;
1074
+
salary.arrears = 0;
1075
+
salary.leaveEncashment = 0;
1076
+
salary.gratuity = 0;
1077
+
salary.hra = 0;
1078
+
salary.entertainmentAllowance = 0;
1079
+
salary.professionalTax = 0;
1080
+
salary.otherComponents = 0;
1081
+
perq.rentFreeAccommodation = 0;
1082
+
perq.concessionInRent = 0;
1083
+
perq.companyCar = 0;
1084
+
perq.freeUtilities = 0;
1085
+
perq.medicalFacilities = 0;
1086
+
perq.interestFreeLoans = 0;
1087
+
perq.stockOptions = 0;
1088
+
perq.educationForChildren = 0;
1089
+
profits.terminationCompensation = 0;
1090
+
profits.retirementCompensation = 0;
1091
+
profits.goldenHandshake = 0;
1092
+
profits.keymanInsurancePayout = 0;
1093
+
profits.preEmploymentPayments = 0;
1094
+
profits.postResignationPayments = 0;
1095
+
foreignRetirement.AmountFrom89ACountry = 0;
1096
+
foreignRetirement.AmountFromNon89ACountry = 0;
1097
+
1098
+
REQUIRE(incomeSalaries.calculateIncomeUnderHeadSalaries() == Catch::Approx(950000 - deductions.calculateTotalDeductions())); // Adjust the expected value as needed
1099
+
1100
+
// Test with modified salary values
1101
+
salary.basicSalary = 1000000;
1102
+
salary.pension = 50000;
1103
+
salary.dearnessAllowance = 25000;
1104
+
salary.bonusCommissions = 60000;
1105
+
1106
+
REQUIRE(incomeSalaries.calculateIncomeUnderHeadSalaries() == Catch::Approx(1085000 - deductions.calculateTotalDeductions())); // Adjust the expected value as needed
REQUIRE(incomeSalaries.calculateIncomeUnderHeadSalaries() == Catch::Approx(1154000 - deductions.calculateTotalDeductions())); // Adjust the expected value as needed
1119
+
1120
+
// Test with modified profits values
1121
+
profits.terminationCompensation = 10000;
1122
+
profits.retirementCompensation = 5000;
1123
+
profits.goldenHandshake = 2000;
1124
+
profits.keymanInsurancePayout = 3000;
1125
+
profits.preEmploymentPayments = 1500;
1126
+
profits.postResignationPayments = 2500;
1127
+
REQUIRE(incomeSalaries.calculateIncomeUnderHeadSalaries() == Catch::Approx(1128000)); // Adjust the expected value as needed
1128
+
1129
+
// Test with modified foreign retirement values
1130
+
foreignRetirement.AmountFrom89ACountry = 10000;
1131
+
foreignRetirement.AmountFromNon89ACountry = 5000;
1132
+
REQUIRE(incomeSalaries.calculateIncomeUnderHeadSalaries() == Catch::Approx(1133000)); // Adjust the expected value as needed
1133
+
1134
+
// Test with old tax regime
1135
+
empDetails.oldTaxRegime = true;
1136
+
exemptions.rentPaid = 240000;
1137
+
exemptions.metroCity = true;
1138
+
exemptions.ltaAmount = 30000;
1139
+
exemptions.childrenEduAllowance = 4800;
1140
+
exemptions.hostelAllowance = 7200;
1141
+
exemptions.transportAllowance = 19200;
1142
+
exemptions.totalPension = 0;
1143
+
exemptions.commutedPension = 0;
1144
+
exemptions.vrsCompensation = 0;
1145
+
REQUIRE(incomeSalaries.calculateIncomeUnderHeadSalaries() == Catch::Approx(1193000 - exemptions.calculateTotalExemptions() - lessUnder89A.calculateLess())); // Adjust the expected value as needed
1146
+
1147
+
// Test with new tax regime
1148
+
empDetails.oldTaxRegime = false;
1149
+
REQUIRE(incomeSalaries.calculateIncomeUnderHeadSalaries() == Catch::Approx(1168000)); // Adjust the expected value as needed
1150
+
}
1151
+
1066
1152
}
1153
+
/*
1067
1154
1068
1155
// --- IncomeUnderHouseProperty Class Tests ---
1069
1156
TEST_CASE("IncomeUnderHouseProperty Initialization from JSON", "[IncomeUnderHouseProperty]") {
@@ -1082,6 +1169,75 @@ TEST_CASE("IncomeUnderHouseProperty Initialization from JSON", "[IncomeUnderHous
0 commit comments