Skip to content

Instantly share code, notes, and snippets.

View PlatinumItguru's full-sized avatar

PlatinumItguru

View GitHub Profile
@isTest
private class TestDeleteRestrictInvoice {
// Invoice generator, with or without a Line Item
static Invoice__c createNewInvoice(Boolean withLineItem) {
// Create test Invoice and insert it into the database
Invoice__c invoice = new Invoice__c();
insert invoice;
// Create test Line Item and insert it into the database, if withLineItem == true
@isTest
private class TestDeleteRestrictInvoice {
// Invoice generator, with or without a Line Item
static Invoice__c createNewInvoice(Boolean withLineItem) {
// Create test Invoice and insert it into the database
Invoice__c invoice = new Invoice__c();
insert invoice;
// The following is needed if you are following the tutorial