Skip to content

Instantly share code, notes, and snippets.

@mzakirhossain
Created April 14, 2020 10:05
Show Gist options
  • Save mzakirhossain/a869f6e06ffc6106dcd4b7658a5aacd4 to your computer and use it in GitHub Desktop.
Save mzakirhossain/a869f6e06ffc6106dcd4b7658a5aacd4 to your computer and use it in GitHub Desktop.
Test Class for CustNotify and CustNotifyScheduledCron
@isTest
public with sharing class TestCustNotify {
@TestSetup
static void insertNewOpportunity() {
Account objAccount = new Account(Name = 'Test Acc1', BillingCity = 'Test City', BillingState = 'Test State',
BillingStreet = 'Test Street', BillingPostalCode = '12345',
BillingCountry = 'Test Country', Phone = '123456');
insert objAccount;
Opportunity objOpp = new Opportunity(Name = 'Test Opp', AccountId = objAccount.Id, StageName = 'Verbal Confirmation', CloseDate = Date.today());
insert objOpp;
}
@IsTest
static void methodTest() {
Test.startTest();
SchedulableContext sc = null;
try {
CustNotifyScheduledCron.execute(sc);
}catch(Exception e) {
}
Test.stopTest();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment