algorithms-sandbox/datastructures/java/test/be/brainbaking/datastructures/hashtable/HashTableTest.java

19 lines
434 B
Java
Raw Normal View History

2018-03-27 09:21:32 +02:00
package be.brainbaking.datastructures.hashtable;
import org.junit.jupiter.api.Test;
2018-03-27 13:03:12 +02:00
import static org.junit.jupiter.api.Assertions.assertEquals;
2018-03-27 09:21:32 +02:00
public class HashTableTest {
@Test
2018-03-27 13:03:12 +02:00
public void add_increasesSize_andAbleToGetValue() {
HashTable<Integer, Integer> table = new HashTable<>();
table.put(123, 445);
2018-03-27 09:21:32 +02:00
2018-03-27 13:03:12 +02:00
assertEquals(1, table.size());
assertEquals(445, (int) table.get(123));
2018-03-27 09:21:32 +02:00
}
}