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.Connection;
import java.sql.DriverManager; import java.sql.DriverManager;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
@TestInstance(Lifecycle.PER_CLASS) @TestInstance(Lifecycle.PER_CLASS)
public class PublicAccessModifierUnitTest { public class PublicAccessModifierUnitTest {
@ -25,7 +27,20 @@ public class PublicAccessModifierUnitTest {
public void whenUsingIntegerMaxValueField_maxPossibleIntValueIsReturned() { public void whenUsingIntegerMaxValueField_maxPossibleIntValueIsReturned() {
assertEquals(2147483647, Integer.MAX_VALUE); //static field 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 @Test
public void whenUsingStringToLowerCase_stringTurnsToLowerCase() { public void whenUsingStringToLowerCase_stringTurnsToLowerCase() {
assertEquals("alex", "ALEX".toLowerCase()); assertEquals("alex", "ALEX".toLowerCase());