You need to sign in to do that
Don't have an account?
Jonathan Crow 6
Apex Test Coverage Error on Unexpected token 'void'
I am still new to Apex testing and am trying to build a test class on the following, but keep running into the error message “Unexpected token 'void' on the second line of the test class. Can somebody tell me where I went wrong?
Here is my class:
Here is my test class:
Here is my class:
public class MyNewCaseController { public string filterId {get; set;} public MyNewCaseController(ApexPages.StandardController ctrl){ string filter = ApexPages.currentPage().getParameters().get('filterId'); if (filter != null) filterId = filter; } }
Here is my test class:
@isTest public static void MyNewCaseControllerTest { string testFilterId = MyNewCaseController.filterId; public static void MyNewCaseControllerTest(ApexPages.StandardController ctrl){ string filter = ApexPages.currentPage().getParameters().get(CommunitiesCaseControllerTest.testFilterId); if (filter != null) testFilterId = filter; } }
try something like below.
If this helps, Please mark it as best answer.
Thanks!!