-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParameterTest.java
More file actions
31 lines (23 loc) · 822 Bytes
/
ParameterTest.java
File metadata and controls
31 lines (23 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package httpserver;
import org.junit.Test;
import static org.junit.Assert.*;
public class ParameterTest {
@Test
public void hasKey() throws Exception {
Parameter parameter = new Parameter("key", "value");
assertEquals("key", parameter.getKey());
}
@Test
public void hasValue() throws Exception {
Parameter parameter = new Parameter("key", "value");
assertEquals("value", parameter.getValue());
}
@Test
public void checksEqualityByKeyAndValue() throws Exception {
Parameter parameter1 = new Parameter("key", "value");
Parameter parameter2 = new Parameter("key", "value");
Parameter parameter3 = new Parameter("key", "val");
assertEquals(parameter1, parameter2);
assertNotEquals(parameter1, parameter3);
}
}