Skip to content

Commit 81561dd

Browse files
authored
Create DictionaryTest.java
1 parent 1c39024 commit 81561dd

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.thealgorithms.datastructures.dictionary;
2+
3+
import org.junit.jupiter.api.Assertions;
4+
import org.junit.jupiter.api.Test;
5+
6+
public class DictionaryTest {
7+
8+
@Test
9+
void test() {
10+
Dictionary dict = new Dictionary("asdf", "a");
11+
Assertions.assertEquals(dict.get("asdf"), "a");
12+
dict.put("aa", "hello");
13+
Assertions.assertEquals(dict.get("aa"), "hello");
14+
dict.put("aa", "aaa");
15+
Assertions.assertEquals(dict.get("aa"), "aaa");
16+
dict.remove("aa");
17+
Assertions.assertEquals(dict.get("aa"), null);
18+
Assertions.assertEquals(dict.containsKey("aa"), false);
19+
}
20+
}

0 commit comments

Comments
 (0)