diff options
| author | benal01 <bja4245@rit.edu> | 2025-03-30 16:45:38 -0400 | 
|---|---|---|
| committer | benal01 <bja4245@rit.edu> | 2025-03-30 16:45:38 -0400 | 
| commit | 44323effa5ebdbf5146d028aa4d966cbb87a7f58 (patch) | |
| tree | 621e12fcfc14b18e4eed518d1f9bc1f73a7f371d /ufund-api/src/test/java/com/ufund/api/ufundapi/model | |
| parent | 5eba2e924c57a7771c002fa3833beb5ed4275fd2 (diff) | |
| parent | 01667682d27a7f3a094cd24fe4fe2c2a2f503660 (diff) | |
| download | JellySolutions-44323effa5ebdbf5146d028aa4d966cbb87a7f58.tar.gz JellySolutions-44323effa5ebdbf5146d028aa4d966cbb87a7f58.tar.bz2 JellySolutions-44323effa5ebdbf5146d028aa4d966cbb87a7f58.zip  | |
Merge branch 'list-and-cupboard-component-refactor' of https://github.com/RIT-SWEN-261-02/team-project-2245-swen-261-02-2b-jellysolutions into list-and-cupboard-component-refactor
Diffstat (limited to 'ufund-api/src/test/java/com/ufund/api/ufundapi/model')
| -rw-r--r-- | ufund-api/src/test/java/com/ufund/api/ufundapi/model/NeedTest.java | 51 | ||||
| -rw-r--r-- | ufund-api/src/test/java/com/ufund/api/ufundapi/model/UserTest.java | 7 | 
2 files changed, 34 insertions, 24 deletions
diff --git a/ufund-api/src/test/java/com/ufund/api/ufundapi/model/NeedTest.java b/ufund-api/src/test/java/com/ufund/api/ufundapi/model/NeedTest.java index 6b4ddfc..c7d17c7 100644 --- a/ufund-api/src/test/java/com/ufund/api/ufundapi/model/NeedTest.java +++ b/ufund-api/src/test/java/com/ufund/api/ufundapi/model/NeedTest.java @@ -14,23 +14,26 @@ public class NeedTest {      public void createNeed() {          String name = "Jellyfish"; -        double maxGoal = 100.00; -        GoalType type = GoalType.MONETARY; -        Need need = new Need(name, type, maxGoal); +        String location = "Atlantis"; +        double maxGoal = 100.0; +        GoalType type = Need.GoalType.MONETARY; +        boolean urgent = false; +        var need = new Need(name, location, maxGoal, type, urgent);          assertNotNull(need);      }      @Test      public void testFields() {          String name = "Jellyfish"; -        int id = 0; -        double maxGoal = 100.00; -        GoalType type = GoalType.MONETARY; -        Need need = new Need(name, type, maxGoal); +        String location = "Atlantis"; +        double maxGoal = 100.0; +        GoalType type = Need.GoalType.MONETARY; +        boolean urgent = false; +        var need = new Need(name, location, maxGoal, type, urgent);          assertEquals(name, need.getName()); -        assertEquals(id, need.getId()); +        assertEquals(0, need.getId());          assertEquals(maxGoal, need.getMaxGoal());          assertEquals(type, need.getType());      } @@ -38,9 +41,11 @@ public class NeedTest {      @Test      public void testCurrentGoal() {          String name = "Jellyfish"; -        double maxGoal = 100.00; -        GoalType type = GoalType.MONETARY; -        Need need = new Need(name, type, maxGoal); +        String location = "Atlantis"; +        double maxGoal = 100.0; +        GoalType type = Need.GoalType.MONETARY; +        boolean urgent = false; +        var need = new Need(name, location, maxGoal, type, urgent);          double current = 0.00;          need.setCurrent(current); @@ -60,9 +65,11 @@ public class NeedTest {      public void testFilterAttributes() {          String name = "Jellyfish"; -        double maxGoal = 100.00; -        GoalType type = GoalType.MONETARY; -        Need need = new Need(name, type, maxGoal); +        String location = "Atlantis"; +        double maxGoal = 100.0; +        GoalType type = Need.GoalType.MONETARY; +        boolean urgent = false; +        var need = new Need(name, location, maxGoal, type, urgent);          String[] filterAttributes = {"seaweed", "divers", "pacific", "plankton"}; @@ -75,9 +82,11 @@ public class NeedTest {      public void testSetMaxGoal() {          String name = "Jellyfish"; -        double maxGoal = 100.00; -        GoalType type = GoalType.MONETARY; -        Need need = new Need(name, type, maxGoal); +        String location = "Atlantis"; +        double maxGoal = 100.0; +        GoalType type = Need.GoalType.MONETARY; +        boolean urgent = false; +        var need = new Need(name, location, maxGoal, type, urgent);          double newGoal = 200.00;          need.setMaxGoal(newGoal); @@ -90,9 +99,11 @@ public class NeedTest {      public void testSetName() {          String name = "Jellyfish"; -        double maxGoal = 100.00; -        GoalType type = GoalType.MONETARY; -        Need need = new Need(name, type, maxGoal); +        String location = "Atlantis"; +        double maxGoal = 100.0; +        GoalType type = Need.GoalType.MONETARY; +        boolean urgent = false; +        var need = new Need(name, location, maxGoal, type, urgent);          String newName = "TESTINGFUN";          need.setName(newName); diff --git a/ufund-api/src/test/java/com/ufund/api/ufundapi/model/UserTest.java b/ufund-api/src/test/java/com/ufund/api/ufundapi/model/UserTest.java index 517a7e2..01b558c 100644 --- a/ufund-api/src/test/java/com/ufund/api/ufundapi/model/UserTest.java +++ b/ufund-api/src/test/java/com/ufund/api/ufundapi/model/UserTest.java @@ -52,7 +52,7 @@ public class UserTest {          String expectedName = "Bob";          User user = User.create(expectedName, "pass"); -        Need need = new Need("Test", 0, 100, Need.GoalType.MONETARY); +        Need need = new Need("Test", "Atlantis", 0, 100, Need.GoalType.MONETARY, false);          Need[] needs = { need };          when(cupboardService.getNeed(0)).thenReturn(need); @@ -71,9 +71,8 @@ public class UserTest {          String expectedName = "Bob";          User user = User.create(expectedName, "pass"); -        Need need = new Need("Test", 0, 100, Need.GoalType.MONETARY); -        Need need2 = new Need("Test2", 0, 100, Need.GoalType.MONETARY); - +        Need need = new Need("Test", "Atlantis", 0, 100, Need.GoalType.MONETARY, false); +        Need need2 = new Need("Test2", "Atlantis", 0, 100, Need.GoalType.MONETARY, false);          when(cupboardService.getNeed(0)).thenReturn(need2);          user.addToBasket(need);  | 
