You need to sign in to do that
Don't have an account?

Defining type for testMethod methods must be declared as IsTest
public class JSONObject { public class value { } public class JSONException extends Exception {} public class JSONTokener { } public static testmethod void test_valueToString() { /* Make sure that the JSON rendered by this class passes validation by parsers from http://json.org/json2.js and http://www.jsonlint.com. For example: {foo: "bar"} is invalid {"foo": "bar"} is valid */ } }getting below exception
Error: Compile Error: Defining type for testMethod methods must be declared as IsTest at line 15 column 36
if i try adding @isTest method end up with this error
Compile Error: testMethod are by default IsTest at line 16 column 36
Can someone please help with this
public static testmethod void test_valueToString() {
Am not sure what exactly you are trying to achieve but if you are writing a test class then use @istest annotation at the beginning of the parent class.
i.e. in my case earlier i was able to declare inside above class JsonObject.JsonTokener tkr = new JsonTokener('//ff \n{}');
but outside the class how i can create variable of jsonTokener
It will work.