Changeset 4 for issuevalue/src/test/java
- Timestamp:
- 09/18/19 10:00:22 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issuevalue/src/test/java/geniusweb/issuevalue/BidTest.java
r1 r4 17 17 import com.fasterxml.jackson.databind.ObjectMapper; 18 18 19 import geniusweb.issuevalue.Bid;20 import geniusweb.issuevalue.DiscreteValue;21 import geniusweb.issuevalue.NumberValue;22 import geniusweb.issuevalue.Value;23 19 import tudelft.utilities.junit.GeneralTests; 24 20 … … 125 121 } 126 122 123 @Test 124 public void testMerge() { 125 Map<String, Value> issuevalues = new HashMap<>(); 126 issuevalues.put(ISSUE1, VALUE1); 127 Bid partial1 = new Bid(issuevalues); 128 129 issuevalues = new HashMap<>(); 130 issuevalues.put(ISSUE2, VALUE2); 131 Bid partial2 = new Bid(issuevalues); 132 133 Bid mergedbid = partial1.merge(partial2); 134 assertEquals(bidc, mergedbid); 135 } 136 137 @Test(expected = IllegalArgumentException.class) 138 public void testMergeIssuesOverlap() { 139 Map<String, Value> issuevalues = new HashMap<>(); 140 issuevalues.put(ISSUE1, VALUE1); 141 Bid partial1 = new Bid(issuevalues); 142 143 issuevalues = new HashMap<>(); 144 issuevalues.put(ISSUE1, VALUE2); 145 Bid partial2 = new Bid(issuevalues); 146 147 partial1.merge(partial2); 148 } 149 150 @Test 151 public void smokeTestConstructor2() { 152 new Bid("issue", new DiscreteValue("dss")); 153 } 154 155 @Test 156 public void smokeTestConstructor2b() { 157 new Bid("issue", new NumberValue("0.5")); 158 } 159 160 @Test(expected = NullPointerException.class) 161 public void smokeTestConstructor2Null1() { 162 new Bid(null, new DiscreteValue("dss")); 163 } 164 165 @Test(expected = NullPointerException.class) 166 public void smokeTestConstructor2Null2() { 167 new Bid("issue", null); 168 } 169 127 170 }
Note:
See TracChangeset
for help on using the changeset viewer.