From b8e7d3400b08f237a65f109ff157fa50fb3499cb Mon Sep 17 00:00:00 2001 From: MJ <102379923+mgellada-sd@users.noreply.github.com> Date: Wed, 16 Aug 2023 12:42:07 -0400 Subject: [PATCH] Removes AccountContactRelation from test so ContactsToMultipleAccounts feature isn't required (#78) * Removes AccountContactRElation from test so ContactsToMultipleAccounts feature isn't required * Removing ContactsToMultipleAccounts from scratch def --- config/project-scratch-def.json | 1 - force-app/main/default/classes/SOQL_Test.cls | 42 ++++++++++---------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/config/project-scratch-def.json b/config/project-scratch-def.json index b809d5e8..ab6fa8be 100644 --- a/config/project-scratch-def.json +++ b/config/project-scratch-def.json @@ -3,7 +3,6 @@ "edition": "Developer", "features": [ "EnableSetPasswordInApi", - "ContactsToMultipleAccounts", "PersonAccounts" ], "settings": { diff --git a/force-app/main/default/classes/SOQL_Test.cls b/force-app/main/default/classes/SOQL_Test.cls index df1c8398..2c3d552c 100644 --- a/force-app/main/default/classes/SOQL_Test.cls +++ b/force-app/main/default/classes/SOQL_Test.cls @@ -766,7 +766,7 @@ private class SOQL_Test { Map binding = builder.binding(); Assert.areEqual('Test%', binding.get('v1')); } - + @IsTest static void notStartsWith() { // Test @@ -881,61 +881,61 @@ private class SOQL_Test { @IsTest static void inlcudesAll() { // Setup - List roles = new List{ 'Business User', 'Decision Maker' }; + List ratings = new List{ 'Hot', 'Warm' }; // Test - SOQL builder = SOQL.of(AccountContactRelation.SObjectType) - .with(AccountContactRelation.Id) - .whereAre(SOQL.Filter.with(AccountContactRelation.Roles).includesAll(roles)); + SOQL builder = SOQL.of(Account.SObjectType) + .with(Account.Id) + .whereAre(SOQL.Filter.with(Account.Rating).includesAll(ratings)); // Verify String soql = builder.toString(); - Assert.areEqual('SELECT Id FROM AccountContactRelation WHERE Roles INCLUDES (\'Business User;Decision Maker\')', soql); + Assert.areEqual('SELECT Id FROM Account WHERE Rating INCLUDES (\'Hot;Warm\')', soql); } @IsTest static void inlcudesSome() { // Setup - List roles = new List{ 'Executive Sponsor', 'Economic Decision Maker' }; + List ratings = new List{ 'Hot', 'Warm' }; // Test - SOQL builder = SOQL.of(AccountContactRelation.SObjectType) - .with(AccountContactRelation.Id) - .whereAre(SOQL.Filter.with(AccountContactRelation.Roles).includesSome(roles)); + SOQL builder = SOQL.of(Account.SObjectType) + .with(Account.Id) + .whereAre(SOQL.Filter.with(Account.Rating).includesSome(ratings)); // Verify String soql = builder.toString(); - Assert.areEqual('SELECT Id FROM AccountContactRelation WHERE Roles INCLUDES (\'Executive Sponsor\', \'Economic Decision Maker\')', soql); + Assert.areEqual('SELECT Id FROM Account WHERE Rating INCLUDES (\'Hot\', \'Warm\')', soql); } @IsTest static void excludesAll() { // Setup - List roles = new List{ 'Technical Buyer', 'Economic Buyer' }; + List ratings = new List{ 'Hot', 'Warm' }; // Test - SOQL builder = SOQL.of(AccountContactRelation.SObjectType) - .with(AccountContactRelation.Id) - .whereAre(SOQL.Filter.with(AccountContactRelation.Roles).excludesAll(roles)); + SOQL builder = SOQL.of(Account.SObjectType) + .with(Account.Id) + .whereAre(SOQL.Filter.with(Account.Rating).excludesAll(ratings)); // Verify String soql = builder.toString(); - Assert.areEqual('SELECT Id FROM AccountContactRelation WHERE Roles EXCLUDES (\'Technical Buyer\', \'Economic Buyer\')', soql); + Assert.areEqual('SELECT Id FROM Account WHERE Rating EXCLUDES (\'Hot\', \'Warm\')', soql); } @IsTest static void excludesSome() { // Setup - List roles = new List{ 'Evaluator', 'Influencer' }; + List ratings = new List{ 'Hot', 'Warm' }; // Test - SOQL builder = SOQL.of(AccountContactRelation.SObjectType) - .with(AccountContactRelation.Id) - .whereAre(SOQL.Filter.with(AccountContactRelation.Roles).excludesSome(roles)); + SOQL builder = SOQL.of(Account.SObjectType) + .with(Account.Id) + .whereAre(SOQL.Filter.with(Account.Rating).excludesSome(ratings)); // Verify String soql = builder.toString(); - Assert.areEqual('SELECT Id FROM AccountContactRelation WHERE Roles EXCLUDES (\'Evaluator;Influencer\')', soql); + Assert.areEqual('SELECT Id FROM Account WHERE Rating EXCLUDES (\'Hot;Warm\')', soql); } @IsTest