You need to sign in to do that
Don't have an account?
How to write testMethod for Remoting method?
Hi All,
I wanted to write a test method for my Javascript Remoting controller.
global class remoteTest { @RemoteAction global static Contact[] findContacts(string Name) { Name = '%'+Name+'%'; Contact[] c = [SELECT ID, Name, Phone, Email from Contact where NAME LIKE :Name ]; return c; } }
It would be appreciative if any one could assist regarding this, thanks in advance.
Regards,
Zubair.
You would perform the test the same as any other:
It's normal Apex Code, and as such, it can be covered like any other Apex Code. Note that as a matter of simplification of the test, the name of the contact was set to something incredibly unlikely to found in any database (▼ is the control character U+001F).