From 170305c72002b9e18e3cd62361efbfc07618739d Mon Sep 17 00:00:00 2001 From: mokha Date: Sun, 5 May 2019 18:01:28 -0600 Subject: start to write tests for existing TaxReturn code. --- assignments/assignment1/README.md | 9 +++++++-- .../main/java/ca/mokhan/assignment1/TaxReturn.java | 2 ++ .../java/ca/mokhan/assignment1/TaxReturnTest.java | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 assignments/assignment1/src/test/java/ca/mokhan/assignment1/TaxReturnTest.java diff --git a/assignments/assignment1/README.md b/assignments/assignment1/README.md index 68a39f0..c090240 100644 --- a/assignments/assignment1/README.md +++ b/assignments/assignment1/README.md @@ -234,6 +234,11 @@ If the total of a number (x) and its subsequent number (x+1) is a value divisibl If the number is prime, print “prime”. 10. Modify the following program to the specifications given below: -Add a new status – SingleParent – where the tax is computed as a SINGLE but with a further reduction of $5000 per child. -Add a new tax condition – if the income is greater than $249,999 for SINGLE, then add a tax of 25% on income amount above $150,000; if the income is greater than $349,999 for MARRIED, then add a tax of 35% on income amount above $200,000. + +* Add a new status – + SingleParent – where the tax is computed as a SINGLE but with a further reduction of $5000 per child. +* Add a new tax condition – + if the income is greater than $249,999 for SINGLE, then add a tax of 25% on income amount above $150,000; + if the income is greater than $349,999 for MARRIED, then add a tax of 35% on income amount above $200,000. + Unknown status – if the status doesn’t belong to SINGLE or MARRIED or SINGLE_PARENT, then compute a 33% tax on the income. diff --git a/assignments/assignment1/src/main/java/ca/mokhan/assignment1/TaxReturn.java b/assignments/assignment1/src/main/java/ca/mokhan/assignment1/TaxReturn.java index 18aa28e..9137268 100644 --- a/assignments/assignment1/src/main/java/ca/mokhan/assignment1/TaxReturn.java +++ b/assignments/assignment1/src/main/java/ca/mokhan/assignment1/TaxReturn.java @@ -1,3 +1,5 @@ +package ca.mokhan.assignment1; + import java.util.Scanner; public class TaxReturn { diff --git a/assignments/assignment1/src/test/java/ca/mokhan/assignment1/TaxReturnTest.java b/assignments/assignment1/src/test/java/ca/mokhan/assignment1/TaxReturnTest.java new file mode 100644 index 0000000..2322700 --- /dev/null +++ b/assignments/assignment1/src/test/java/ca/mokhan/assignment1/TaxReturnTest.java @@ -0,0 +1,19 @@ +package ca.mokhan.assignment1; + +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 testTrue() { + assertTrue(true); + } +} -- cgit v1.2.3