aboutsummaryrefslogtreecommitdiff
path: root/ufund-api/src/test/java/com/ufund/api/ufundapi/model/NeedTest.java
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2025-03-17 17:17:06 -0400
committersowgro <tpoke.ferrari@gmail.com>2025-03-17 17:17:06 -0400
commitbaf4f2c0189d5c5f8ade40f0ceaed3ab7a7d4754 (patch)
treee9213224b8f1b35b860f016a6a3d1318def8aae2 /ufund-api/src/test/java/com/ufund/api/ufundapi/model/NeedTest.java
parentbf33fa3ca9f29b1e75cc077ae2eaaf4f5725e4b3 (diff)
parentd737551fba5617843f3014be6994490dd4328183 (diff)
downloadJellySolutions-baf4f2c0189d5c5f8ade40f0ceaed3ab7a7d4754.tar.gz
JellySolutions-baf4f2c0189d5c5f8ade40f0ceaed3ab7a7d4754.tar.bz2
JellySolutions-baf4f2c0189d5c5f8ade40f0ceaed3ab7a7d4754.zip
Merge remote-tracking branch 'origin/main' into cupboard-component
# Conflicts: # ufund-api/data/cupboard.json # ufund-ui/src/app/app.module.ts
Diffstat (limited to 'ufund-api/src/test/java/com/ufund/api/ufundapi/model/NeedTest.java')
-rw-r--r--ufund-api/src/test/java/com/ufund/api/ufundapi/model/NeedTest.java49
1 files changed, 37 insertions, 12 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 50b5cf2..6b4ddfc 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,13 +14,10 @@ public class NeedTest {
public void createNeed() {
String name = "Jellyfish";
- int id = 0;
double maxGoal = 100.00;
GoalType type = GoalType.MONETARY;
- Need need = new Need(name, id, maxGoal, type);
-
+ Need need = new Need(name, type, maxGoal);
assertNotNull(need);
-
}
@Test
@@ -29,7 +26,7 @@ public class NeedTest {
int id = 0;
double maxGoal = 100.00;
GoalType type = GoalType.MONETARY;
- Need need = new Need(name, id, maxGoal, type);
+ Need need = new Need(name, type, maxGoal);
assertEquals(name, need.getName());
@@ -41,32 +38,31 @@ public class NeedTest {
@Test
public void testCurrentGoal() {
String name = "Jellyfish";
- int id = 0;
double maxGoal = 100.00;
GoalType type = GoalType.MONETARY;
- Need need = new Need(name, id, maxGoal, type);
+ Need need = new Need(name, type, maxGoal);
double current = 0.00;
need.setCurrent(current);
- assertEquals(need.getCurrent(), current);
+ assertEquals(current, need.getCurrent());
current = 100.00;
need.setCurrent(current);
- assertEquals(need.getCurrent(), current);
+ assertEquals(current, need.getCurrent());
current = -100.00;
need.setCurrent(current);
- assertEquals(need.getCurrent(), current);
+ assertEquals(current, need.getCurrent());
}
+
@Test
public void testFilterAttributes() {
String name = "Jellyfish";
- int id = 0;
double maxGoal = 100.00;
GoalType type = GoalType.MONETARY;
- Need need = new Need(name, id, maxGoal, type);
+ Need need = new Need(name, type, maxGoal);
String[] filterAttributes = {"seaweed", "divers", "pacific", "plankton"};
@@ -75,4 +71,33 @@ public class NeedTest {
assertEquals(need.getFilterAttributes(), filterAttributes);
}
+ @Test
+ public void testSetMaxGoal() {
+
+ String name = "Jellyfish";
+ double maxGoal = 100.00;
+ GoalType type = GoalType.MONETARY;
+ Need need = new Need(name, type, maxGoal);
+
+ double newGoal = 200.00;
+ need.setMaxGoal(newGoal);
+
+
+ assertEquals(newGoal, need.getMaxGoal());
+ }
+
+ @Test
+ public void testSetName() {
+
+ String name = "Jellyfish";
+ double maxGoal = 100.00;
+ GoalType type = GoalType.MONETARY;
+ Need need = new Need(name, type, maxGoal);
+
+ String newName = "TESTINGFUN";
+ need.setName(newName);
+
+ assertEquals(newName, need.getName());
+ }
+
}