You need to sign in to do that
Don't have an account?
prasanth kumar
map with test class not wokring. please help.
sir, please solve this error.
simple test class for map. getting error at line 7 : Variable is not visible: colors @istest public class apex2test { testmethod static void apex2test() { apex2 ap=new apex2(); system.assertEquals(ap.colors.get('green'),'this is start signal'); } } apex class:---------- public class apex2 { public 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()); } }
All Answers