@@ -10,7 +10,7 @@ import static org.junit.Assert.assertNull
1010class ConvertStringToInt {
1111
1212 @Test
13- void givenString_thenConvertToIntegerUsingAsInteger () {
13+ void givenString_whenUsingAsInteger_thenConvertToInteger () {
1414 def stringNum = " 123"
1515 def invalidString = " 123a"
1616 Integer expectedInteger = 123
@@ -22,7 +22,7 @@ class ConvertStringToInt {
2222 }
2323
2424 @Test
25- void givenString_thenConvertToIntUsingAsInt () {
25+ void givenString_whenUsingAsInt_thenConvertToInt () {
2626 def stringNum = " 123"
2727 int expectedInt = 123
2828 int intNum = stringNum as int
@@ -31,7 +31,7 @@ class ConvertStringToInt {
3131 }
3232
3333 @Test
34- void givenString_thenConvertToIntegerUsingToInteger () {
34+ void givenString_whenUsingToInteger_thenConvertToInteger () {
3535 def stringNum = " 123"
3636 int expectedInt = 123
3737 int intNum = stringNum. toInteger()
@@ -40,7 +40,7 @@ class ConvertStringToInt {
4040 }
4141
4242 @Test
43- void givenString_thenConvertToIntegerUsingParseInt () {
43+ void givenString_whenUsingParseInt_thenConvertToInteger () {
4444 def stringNum = " 123"
4545 int expectedInt = 123
4646 int intNum = Integer . parseInt(stringNum)
@@ -49,7 +49,7 @@ class ConvertStringToInt {
4949 }
5050
5151 @Test
52- void givenString_thenConvertToIntegerUsingValueOf () {
52+ void givenString_whenUsingValueOf_thenConvertToInteger () {
5353 def stringNum = " 123"
5454 int expectedInt = 123
5555 int intNum = Integer . valueOf(stringNum)
@@ -58,7 +58,7 @@ class ConvertStringToInt {
5858 }
5959
6060 @Test
61- void givenString_thenConvertToIntegerUsingIntValue () {
61+ void givenString_whenUsingIntValue_thenConvertToInteger () {
6262 def stringNum = " 123"
6363 int expectedInt = 123
6464 int intNum = new Integer (stringNum). intValue()
@@ -69,7 +69,7 @@ class ConvertStringToInt {
6969 }
7070
7171 @Test
72- void givenString_thenConvertToIntegerUsingDecimalFormat () {
72+ void givenString_whenUsingDecimalFormat_thenConvertToInteger () {
7373 def stringNum = " 123"
7474 int expectedInt = 123
7575 DecimalFormat decimalFormat = new DecimalFormat (" #" )
0 commit comments