nested datatypes example

This commit is contained in:
m.raheem 2019-08-21 16:49:09 +02:00
parent c1d88b7364
commit 1756cfe008
1 changed files with 15 additions and 0 deletions

View File

@ -11,7 +11,9 @@ import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@TestInstance(Lifecycle.PER_CLASS)
public class PublicAccessModifierUnitTest {
@ -26,6 +28,19 @@ public class PublicAccessModifierUnitTest {
assertEquals(2147483647, Integer.MAX_VALUE); //static field
}
@Test
public void whenUsingEntrySet_keyValuePairsAreReturned() {
Map<String, String> mapObject = new HashMap<String, String>();
mapObject.put("name", "Alex");
for(Map.Entry<String, String> entry : mapObject.entrySet()) {
assertEquals("name", entry.getKey());
assertEquals("Alex", entry.getValue());
}
}
@Test
public void whenUsingStringToLowerCase_stringTurnsToLowerCase() {
assertEquals("alex", "ALEX".toLowerCase());