You need to sign in to do that
Don't have an account?
prasanth kumar
error at simple test class for MAP program.
I am getting error at simple test class for map object. At line 9:Variable is not visible: colors please help me.
@istest public class apex2test { @istest static void mytest() { apex2 ap=new apex2(); system.assertequals(ap.colors.get('red'),'this is stop signal'); } } apex class:---------- public class apex2 { map<string,string> colors; public apex2() { colors=new map<string,string>(); colors.put('red','this is stop signal'); colors.put('green','this is start signal'); colors.put('yellow','thisis slowdown signal'); system.debug('the data of red is: '+colors.get('red')); system.debug('the count of colors is: '+colors.size()); } }
If its helps, please mark as best answer so it will help to other who will serve same problem.
Thanks!
All Answers
If its helps, please mark as best answer so it will help to other who will serve same problem.
Thanks!