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

Test class for STOWD API
Hi All,
Any help in writting test class for the below trigger is appreciated.
trigger test on Mail__c (after update) {
list<Duration__c> durations = new list<Duration__c>();
set<string> trackedFields = new set<string> {'OwnerId', 'Status__c', 'Sub_Status__c'};
STOWD.API.CalculateDurations(durations, trackedFields, 'Request__History', 'ParentId');
database.insert(durations, false);
}
Any help in writting test class for the below trigger is appreciated.
trigger test on Mail__c (after update) {
list<Duration__c> durations = new list<Duration__c>();
set<string> trackedFields = new set<string> {'OwnerId', 'Status__c', 'Sub_Status__c'};
STOWD.API.CalculateDurations(durations, trackedFields, 'Request__History', 'ParentId');
database.insert(durations, false);
}
My mistake, I forget to add static keyword in method.
All Answers
Plz try this and let me know if it works
Might be some update needed according to your requirements
Thanks
Niraj
I am getting "Unexpected token 'testMethod'." error while saving the test class. I just copied your code and pasted to my org.
testMethod is a keyword in Salesforce.
Replace this line :
@istest private void testMethod() {
By:
@istest private void testClassMethod1() {
Now saving test class is fine. When executing "Run test" I m getting the below meeage. I already added test methods to my class.
No idea whats the issue here !
My mistake, I forget to add static keyword in method.
Code I shared earlier was existing and I dont have an idea about flow of the code.
So little curious to know the functions and methods used in it.