Junit | How to test parameters in a method
- by MMRUser
How do I test parameters inside a method itself. For example
class TestClass {
public void paraMethod(String para1, String para2) {
String testPara1 = para1;
String testPara2 = para2;
}
}
class TestingClass {
@Test
public void testParaMethod () throws Exception {
String myPara1 = "MyPara1";
String myPara2 = "MyPara2";
new TestClass().paraMethod(myPara1, myPara2);
}
}
Ok, so is it possible to test if the testPara1 and testPara2 are properly set to the values that I have passed?
Thanks.