You need to sign in to do that
Don't have an account?
justinpauldavis10
Test coverage
I'm having difficulty installing this trigger:
trigger SetAccountField on Account__c (before insert, before update) {
for (Account__c Account__c : Trigger.new) {
Account__c.Scoring__c = 'a00A0000003MnLw';
}
}
Essentially, it updates the lookup field Scoring__c on a custom object called Account.
I'm getting there error: Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required.
What additional code am I missing to facilitate test coverage?
Thanks for any help anyone might have
you just need to create & update an Account__c...and run tests for this class
@isTest
private class Test_class
{
static testMethod void test()
{
// TO DO: implement unit test
Account__c objAccount = new Account__c();
objAccount.name = 'A';
// other mandatory fields
insert objAccount;
objAccount.name = 'B';
update objAccount;
}
}