summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo <mo.khan@gmail.com>2019-07-19 15:52:54 -0600
committermo <mo.khan@gmail.com>2019-07-19 15:52:54 -0600
commit09b7a50505faef9894f832f3652d77e448ce42c7 (patch)
tree555d58f4c396547653fa856f24a4d6191ce8740f
parent77113b1659a5f8b87650c3249e0a5295dc48303b (diff)
add tests for other categories
-rw-r--r--src/Q7/PersonTest.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Q7/PersonTest.java b/src/Q7/PersonTest.java
index 1d79c9d..b7a3d38 100644
--- a/src/Q7/PersonTest.java
+++ b/src/Q7/PersonTest.java
@@ -26,4 +26,25 @@ public class PersonTest extends TestCase {
assertEquals("Underweight", this.subject.getCategory());
}
+
+ public void test_getBMI_normal() {
+ this.subject.setHeight(72);
+ this.subject.setWeight(170);
+
+ assertEquals("Normal", this.subject.getCategory());
+ }
+
+ public void test_getBMI_overweight() {
+ this.subject.setHeight(72);
+ this.subject.setWeight(220);
+
+ assertEquals("Overweight", this.subject.getCategory());
+ }
+
+ public void test_getBMI_obese() {
+ this.subject.setHeight(72);
+ this.subject.setWeight(250);
+
+ assertEquals("Obese", this.subject.getCategory());
+ }
}