You need to sign in to do that
Don't have an account?
Mike Reynolds 6
Test method problems
Hey - I'm new (as everyone on here says) and i'm being thrown by an error message. Here is my test code:
"No tests to run. Add test methods to your test class."
This makes no sense to me. Any ideas?
Thanks - Mike
@isTest public class emailTriggerTestClass { static testMethod void isIncomingEmailTest() { case newCase = new Case(); insert newCase; emailMessage newEmail = new emailMessage(); newEmail.FromAddress = 'Email@No.com'; newEmail.ToAddress = 'Feedback@no.com'; newEmail.CcAddress = 'ccAddress@verify.com'; newEmail.FromName = 'Someones Name'; newEmail.Incoming = True; newEmail.ParentId=newCase.id; test.startTest(); insert newEmail; test.stopTest(); newCase=[select Id, Email_To_Address__c,From_Address__c,Email_CC_Address__c,Email_From_Name__c from case where id =:newEmail.ParentId]; System.assertEquals ('email@no.com', newCase.From_Address__c); System.assertEquals ('Feedback@no.com', newCase.Email_To_Address__c); System.assertEquals ('ccAddress@verify.com', newCase.Email_CC_Address__c); System.assertEquals ('Someones Name', newCase.Email_From_Name__c); } }I'm getting the following error when I try to run my test:
"No tests to run. Add test methods to your test class."
This makes no sense to me. Any ideas?
Thanks - Mike
All Answers
I've test your class here and it's working fine! From where you are executing that test class? Developer Console? Setup? Eclipse?
Make sure your class is saved with the latest code. Setup -> Apex Classes -> Your test Class
Hope to have helped!
Regards.
Don't forget to mark your thread as 'SOLVED' with the answer that best helps you.
-Mike
Can you send a print of it? Did you checked your class in the Setup? Have you tried to close and open the console again? Are you using the top right button Run Test?
Regards
like if your class name is emailTrigger then
emailTrigger et = new emailTrigger();
I was also facing the same issue,
After writing your code in developer console, you must save your code (ctrl+s) then you can run your command which might fix this issue.