summaryrefslogtreecommitdiff
path: root/src/Q4/BanffMarathonRunnerTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/Q4/BanffMarathonRunnerTest.java')
-rw-r--r--src/Q4/BanffMarathonRunnerTest.java63
1 files changed, 0 insertions, 63 deletions
diff --git a/src/Q4/BanffMarathonRunnerTest.java b/src/Q4/BanffMarathonRunnerTest.java
deleted file mode 100644
index 5e41380..0000000
--- a/src/Q4/BanffMarathonRunnerTest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package ca.mokhan.test;
-
-import Q4.*;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class BanffMarathonRunnerTest extends TestCase {
- private BanffMarathonRunner john = new BanffMarathonRunner("John", "Lenthen", 243, 1);
- private BanffMarathonRunner kate = new BanffMarathonRunner("Kate", "Hen", 265, 8);
- private BanffMarathonRunner[] runners = {
- new BanffMarathonRunner("Elena", "Brandon", 341, 1),
- new BanffMarathonRunner("Thomas", "Molson", 273, 2),
- new BanffMarathonRunner("Hamilton", "Winn", 278, 5),
- new BanffMarathonRunner("Suzie", "Sarandin", 329, 7),
- new BanffMarathonRunner("Philip", "Winne", 445, 9),
- new BanffMarathonRunner("Alex", "Trebok", 275, 3),
- new BanffMarathonRunner("Emma", "Pivoto", 275, 4),
- this.john,
- new BanffMarathonRunner("James", "Lean", 334, 1),
- new BanffMarathonRunner("Jane", "Ostin", 412, 1),
- new BanffMarathonRunner("Emily", "Car", 393, 4),
- new BanffMarathonRunner("Daniel", "Hamshire", 299, 4),
- new BanffMarathonRunner("Neda", "Bazdar", 343, 3),
- new BanffMarathonRunner("Aaron", "Smith", 317, 6),
- this.kate
- };
-
- public BanffMarathonRunnerTest(String testName) {
- super(testName);
- }
-
- public static Test suite() {
- return new TestSuite(BanffMarathonRunnerTest.class);
- }
-
- public void testGetFastestRunner() {
- assertEquals(this.john, BanffMarathonRunner.getFastestRunner(this.runners));
- }
-
- public void testGetSecondFastestRunner() {
- assertEquals(this.kate, BanffMarathonRunner.getSecondFastestRunner(this.runners));
- }
-
- public void testGetAverageTime() {
- assertEquals(321, BanffMarathonRunner.getAverageTime(this.runners));
- }
-
- public void testGetAboveAverageRunners() {
- String expected =
- String.join(
- System.lineSeparator(),
- "Thomas 2",
- "Hamilton 5",
- "Alex 3",
- "Emma 4",
- "John 1",
- "Daniel 4",
- "Aaron 6",
- "Kate 8");
- assertEquals(expected, BanffMarathonRunner.getAboveAverageRunners(this.runners));
- }
-}