Leon Hunter 5 years ago
parent
commit
96aa0f0482

+ 9
- 0
src/main/java/rocks/zipcode/quiz3a/collections/WordCounter.java View File

1
+package rocks.zipcode.quiz3a.collections;
2
+
3
+import java.util.Map;
4
+
5
+public class WordCounter {
6
+    public static Map<String, Integer> getWordCountMap() {
7
+        return null;
8
+    }
9
+}

+ 6
- 0
src/main/java/rocks/zipcode/quiz3a/objectorientation/enums/Person.java View File

1
+package rocks.zipcode.quiz3a.objectorientation.enums;
2
+
3
+public enum Person {
4
+    private String firstName;
5
+    private String lastName;
6
+}

+ 4
- 0
src/test/java/rocks/zipcode/quiz3a/collections/bank/FindBankAccountByIdTest.java View File

1
+package rocks.zipcode.quiz3a.collections.bank;
2
+
3
+public class FindBankAccountByIdTest {
4
+}

+ 4
- 0
src/test/java/rocks/zipcode/quiz3a/collections/bank/RemoveBankAccountTest.java View File

1
+package rocks.zipcode.quiz3a.collections.bank;
2
+
3
+public class RemoveBankAccountTest {
4
+}

+ 4
- 0
src/test/java/rocks/zipcode/quiz3a/collections/bank/SetBankAccountsTest.java View File

1
+package rocks.zipcode.quiz3a.collections.bank;
2
+
3
+public class SetBankAccountsTest {
4
+}

+ 0
- 32
src/test/java/rocks/zipcode/quiz3a/collections/food/GetSpiceCountTest.java View File

1
-package rocks.zipcode.quiz3a.collections.food;
2
-
3
-import org.junit.Assert;
4
-import org.junit.Test;
5
-import rocks.zipcode.quiz3a.collections.Food;
6
-import rocks.zipcode.quiz3a.objectorientation.Ginger;
7
-import rocks.zipcode.quiz3a.objectorientation.Pepper;
8
-import rocks.zipcode.quiz3a.objectorientation.Spice;
9
-
10
-import java.util.Map;
11
-
12
-/**
13
- * @author leon on 27/12/2018.
14
- */
15
-public class GetSpiceCountTest {
16
-    @Test
17
-    public void test1() {
18
-        // given
19
-        Food food = new Food();
20
-        food.applySpice((Spice)(Object)new Pepper());
21
-        food.applySpice((Spice)(Object)new Pepper());
22
-        food.applySpice((Spice)(Object)new Ginger());
23
-        food.applySpice((Spice)(Object)new Ginger());
24
-
25
-        // when
26
-        Map<? extends Class<? extends Spice>, Integer> spiceCount = food.getSpiceCount((Class<? extends Spice>)(Object)Pepper.class);
27
-        spiceCount.get(null);
28
-
29
-        // then
30
-//        Assert.assertEquals();
31
-    }
32
-}

+ 4
- 0
src/test/java/rocks/zipcode/quiz3a/collections/wordcounter/GetWordCountMapTest.java View File

1
+package rocks.zipcode.quiz3a.collections.wordcounter;
2
+
3
+public class GetWordCountMapTest {
4
+}

+ 1
- 0
src/test/java/rocks/zipcode/quiz3a/objectorientation/bankaccount/BankAccountPolymorphismTest.java View File

11
  */
11
  */
12
 public class BankAccountPolymorphismTest {
12
 public class BankAccountPolymorphismTest {
13
     BankAccount bankAccount = new BankAccount();
13
     BankAccount bankAccount = new BankAccount();
14
+
14
     @Test
15
     @Test
15
     public void test1() {
16
     public void test1() {
16
         Assert.assertTrue(bankAccount instanceof Transactable);
17
         Assert.assertTrue(bankAccount instanceof Transactable);

+ 0
- 1
src/test/java/rocks/zipcode/quiz3a/objectorientation/employee/EmployeeConstructorTest.java View File

22
         Double expectedHoursWorked = 0.0;
22
         Double expectedHoursWorked = 0.0;
23
         Double expectedBalance = 0.0;
23
         Double expectedBalance = 0.0;
24
         Double expectedBankAccountBalance = 0.0;
24
         Double expectedBankAccountBalance = 0.0;
25
-        Double expectedMoneyEarned = expectedHourlyWage * expectedHoursWorked;
26
 
25
 
27
         Assert.assertNotNull(employee.getBankAccount());
26
         Assert.assertNotNull(employee.getBankAccount());
28
         Assert.assertEquals(expectedHourlyWage, worker.getHourlyWage());
27
         Assert.assertEquals(expectedHourlyWage, worker.getHourlyWage());

+ 1
- 1
src/test/java/rocks/zipcode/quiz3a/objectorientation/employee/SetBankAccountTest.java View File

40
         // given
40
         // given
41
         Employee employee = new Employee();
41
         Employee employee = new Employee();
42
         BankAccount expected = new BankAccount();
42
         BankAccount expected = new BankAccount();
43
-        ((Transactable)expected).setBalance(expectedBalance);
43
+        ((Transactable)expected).deposit(expectedBalance);
44
 
44
 
45
         // when
45
         // when
46
         employee.setBankAccount(expected);
46
         employee.setBankAccount(expected);