summaryrefslogtreecommitdiff
path: root/src/Q10/TaxReturnTest.java
diff options
context:
space:
mode:
authormo <mo.khan@gmail.com>2019-05-25 15:27:51 -0600
committermo <mo.khan@gmail.com>2019-05-25 15:27:51 -0600
commit856c35dbc7080922bfff7c10a7a844a9d0a1cd65 (patch)
tree739b413bc2a29adc35229ef2fd9b30581601a206 /src/Q10/TaxReturnTest.java
parent46f68298527e0c59b9f34003b687259477093fde (diff)
start assignment 2
Diffstat (limited to 'src/Q10/TaxReturnTest.java')
-rw-r--r--src/Q10/TaxReturnTest.java91
1 files changed, 0 insertions, 91 deletions
diff --git a/src/Q10/TaxReturnTest.java b/src/Q10/TaxReturnTest.java
deleted file mode 100644
index c1af186..0000000
--- a/src/Q10/TaxReturnTest.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package ca.mokhan.test;
-
-import Q10.*;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class TaxReturnTest extends TestCase {
- public TaxReturnTest(String testName) {
- super(testName);
- }
-
- public static Test suite() {
- return new TestSuite(TaxReturnTest.class);
- }
-
- public void test_SINGLE_BRACKET1() {
- TaxReturn subject = new TaxReturn(TaxReturn.SINGLE_BRACKET1 - 0.01, TaxReturn.SINGLE);
- assertEquals(3217.4985, subject.getTax());
- }
-
- public void test_SINGLE_BRACKET1_1_CHILD() {
- TaxReturn subject = new TaxReturn(TaxReturn.SINGLE_BRACKET1 - 0.01, TaxReturn.SINGLE, 1);
- assertEquals(2467.4985, subject.getTax());
- }
-
- public void test_SINGLE_BRACKET1_2_CHILDREN() {
- TaxReturn subject = new TaxReturn(TaxReturn.SINGLE_BRACKET1 - 0.01, TaxReturn.SINGLE, 2);
- assertEquals(1717.4985000000001, subject.getTax());
- }
-
- public void test_SINGLE_BRACKET1_3_CHILDREN() {
- TaxReturn subject = new TaxReturn(TaxReturn.SINGLE_BRACKET1 - 0.01, TaxReturn.SINGLE, 3);
- assertEquals(967.4985000000001, subject.getTax());
- }
-
- public void test_SINGLE_BRACKET2() {
- TaxReturn subject = new TaxReturn(TaxReturn.SINGLE_BRACKET2 - 0.01, TaxReturn.SINGLE);
- assertEquals(11743.4972, subject.getTax());
- }
-
- public void test_SINGLE_BRACKET3() {
- TaxReturn subject = new TaxReturn(TaxReturn.SINGLE_BRACKET2 + 0.01, TaxReturn.SINGLE);
- assertEquals(11743.5031, subject.getTax());
- }
-
- // if the income is greater than $249,999 for SINGLE, then add a tax of 25% on income amount above
- // $150,000;
- public void test_SINGLE_Income_Greater_Than_250K() {
- // $0 - $21450: 0.15% = $3,217.5
- // $21450 - $51900: 0.28% = $8,526.0
- // $51900 - $250,000: 0.31% = $61411.0
- // $150,000 - $250,000: 0.25% = $25,000.0
- // total: $98,154.50
-
- TaxReturn subject = new TaxReturn(250000, TaxReturn.SINGLE);
- assertEquals(98154.50, subject.getTax());
- }
-
- public void test_MARRIED_BRACKET1() {
- TaxReturn subject = new TaxReturn(TaxReturn.MARRIED_BRACKET1 - 0.01, TaxReturn.MARRIED);
- assertEquals(5369.9985, subject.getTax());
- }
-
- public void test_MARRIED_BRACKET2() {
- TaxReturn subject = new TaxReturn(TaxReturn.MARRIED_BRACKET2 - 0.01, TaxReturn.MARRIED);
- assertEquals(19565.997200000005, subject.getTax());
- }
-
- public void test_MARRIED_BRACKET3() {
- TaxReturn subject = new TaxReturn(TaxReturn.MARRIED_BRACKET2 + 0.01, TaxReturn.MARRIED);
- assertEquals(19566.003099999998, subject.getTax());
- }
-
- // if the income is greater than $349,999 for MARRIED, then add a tax of 35% on income amount
- // above $200,000.
- public void test_MARRIED_Income_Greater_Than_350K() {
- // $0 - $35,800: 0.15% = $5,370.0
- // $35,800 - $86,500: 0.28% = $14196.000000000002
- // $86,500 - $350,000: 0.31% = $81685.0
- // $200,000 - $350,000: 0.35% = $52500.0
- // total: $153,751.0
- TaxReturn subject = new TaxReturn(350000, TaxReturn.MARRIED);
- assertEquals(153751.0, subject.getTax());
- }
-
- public void test_UNKNOWN_status_Should_tax_at_33_percent() {
- TaxReturn subject = new TaxReturn(100000, 3);
- assertEquals(33000.0, subject.getTax());
- }
-}