You need to sign in to do that
Don't have an account?
shinerajb
Test code for a class with list
what is the test code for this class with list ?
public class A_List
{
public void s()
{
List<Integer> myList = new List<Integer>();
Integer a;
myList.add(a);
Integer myNumber = myList.get(0);
}
}
Hi,
Try the below code snippet as reference:
public class A_List
{
public void s()
{
List<Integer> myList = new List<Integer>();
Integer a;
myList.add(a);
Integer myNumber = myList.get(0);
}
static testMethod void testA_List()
{
A_List obj = new A_List();
obj.s();
}
}
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
Hi
Its working,how can I check it with a value
Hi,
Test code coverage is 100%
code snippet:
You can check vaue by using system.debug(value gg);
Mark as solution , once it satisfy ur requirement.
You can't test any values because everything you created is just a local variable to the method.