You need to sign in to do that
Don't have an account?
magalie pickert
HELP !! !! Test Methods
Hi,
I have a problem egarding Test Methods.
I'm becoming this error: No testMethods found in the selected Apex code for the package
And it is regarding my bevor insert trigger
Do you have any Idea?
Thx
Magda
I have a problem egarding Test Methods.
I'm becoming this error: No testMethods found in the selected Apex code for the package
And it is regarding my bevor insert trigger
Trigger BeforInsertObj on Obj__c (before insert)And my code contains an insert statment:
Code:
public static testMethod void test() { try{ User user = new User(); Obj.Editor__c = user.Id; System.debug('Add a Obj\n'); insert Obj; Obj.Priority__c= 'Low'; Obj.Schedule_Time__c = Date.valueof('2008-12-01'); update Obj; InsertTask(Obj); } catch (DmlException e) { System.debug(e.getMessage()); } }
Do you have any Idea?
Thx
Magda
Code not covered: Line 103 Column 20.
On this line is : public static Task InsertTask(Obj__c obj)
And what I don't understand is why because in my TestMethod I have this code:
I change the test Method to:
But nothing is changed. COde not covered for insertTask :(
Do you have an idea?
Message Edited by magalie pickert on 10-01-2008 01:20 AM
Message Edited by magalie pickert on 10-01-2008 01:34 AM
i fand the problem in my test•
Now I have
Code coverage total %89
with o test failures.
in my testmethod is trigger also tested.
I try to do an upload and i become the same failure of my trigger:
No testMethods found in the selected Apex code for the package
Do you have an Idea
PLEASE HELP ME!
- Your Trigger
- An Apex class that tests your trigger
I don't know what is in your Obj__c and I don't know what you're trying to test, but here's an example of a Trigger:Then, you'll have a separate Apex class that tests the Trigger:
The main idea is:
thx for your help…
But I allready have this.
I have a code coverage 91% !
And my Debug Log :
And my Failure:
I don't understand becose my Test is testing the trigger (see debug)
Message Edited by magalie pickert on 10-01-2008 10:14 PM
Also, are you triggering on Obj__c or Task? And what class are you selecting when you run your Tests?
My Trriger Name
My Debug Log
Thx
Magalie d'Anterroches
And I have yet the same failure by upload my package:
No testMethods found in the selected Apex code for the package
:(
Magalie d'Anterroches
Is your trigger on Obj__c or qaas_Obj__c?
Your Trigger says Trigger BeforInsertObj on qaas__Obj__c but the debug log shows qaas.BeforInsertObj on Obj trigger.
Why are your assert tests based on Task rather than Obj__c?
How are you running the tests? Are you running ALL tests? if so, which class/module is giving you the the "no testmethod" error?
my trigger is on API Name qaas_Obj__c.
In my class a create an Obj:
That's why it is in the debug: qaas.BeforInsertObj on Obj trigger.
I created an asset on InsertTask because it is a method in my class and it was not covered. But now it is covered.
Do I have to create an asset on my Obj too?
I'm still confused why you don't have the same Object type as your "on" as the object you are triggering, eg:
Trigger BeforInsertObj on Obj__c
since that's the object that you are inserting.