package Hashmap;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.*;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import Hashmap.MyGenericHashMap.Entry;

class JunitTest {
	private MyGenericHashMap<Integer,String> h1;
	@BeforeEach
	void list() {
		h1 = new MyGenericHashMap<>();
		h1.put(3009594, "obai");
		h1.put(3129594, "omar");
		h1.put(3129592, "abd");
		h1.put(3129392, "basel");
	}
	
	@Test
	void testPut() {
        h1.put(3009594, "omar");
        String value = h1.getValue(3009594);
        assertEquals("omar",value);
        
	}
	
	@Test
	void testcontainsKey() {
		assertTrue(h1.containsKey(3129592));
		assertFalse(h1.containsKey(3213213));
	}
	
	@Test
	void testSize() {
		assertEquals(4,h1.size());
	}
	
	@Test
	void testisEmpty() {
		assertTrue(h1.isEmpty());
	}

}
