Modified one method
This commit is contained in:
parent
a59aa14400
commit
76cdbd811e
@ -62,10 +62,17 @@ class ConvertStringToInt {
|
|||||||
def stringNum = "123"
|
def stringNum = "123"
|
||||||
int expectedInt = 123
|
int expectedInt = 123
|
||||||
int intNum = new Integer(stringNum).intValue()
|
int intNum = new Integer(stringNum).intValue()
|
||||||
int secondIntNum = new Integer(stringNum)
|
|
||||||
|
|
||||||
assertEquals(intNum, expectedInt)
|
assertEquals(intNum, expectedInt)
|
||||||
assertEquals(secondIntNum, expectedInt)
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void givenString_whenUsingNewInteger_thenConvertToInteger() {
|
||||||
|
def stringNum = "123"
|
||||||
|
int expectedInt = 123
|
||||||
|
int intNum = new Integer(stringNum)
|
||||||
|
|
||||||
|
assertEquals(intNum, expectedInt)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user