Skip to content

Commit

Permalink
Removes AccountContactRelation from test so ContactsToMultipleAccount…
Browse files Browse the repository at this point in the history
…s feature isn't required (#78)

* Removes AccountContactRElation from test so ContactsToMultipleAccounts feature isn't required

* Removing ContactsToMultipleAccounts from scratch def
  • Loading branch information
mgellada-sd authored Aug 16, 2023
1 parent 6a7e541 commit b8e7d34
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 22 deletions.
1 change: 0 additions & 1 deletion config/project-scratch-def.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"edition": "Developer",
"features": [
"EnableSetPasswordInApi",
"ContactsToMultipleAccounts",
"PersonAccounts"
],
"settings": {
Expand Down
42 changes: 21 additions & 21 deletions force-app/main/default/classes/SOQL_Test.cls
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ private class SOQL_Test {
Map<String, Object> binding = builder.binding();
Assert.areEqual('Test%', binding.get('v1'));
}

@IsTest
static void notStartsWith() {
// Test
Expand Down Expand Up @@ -881,61 +881,61 @@ private class SOQL_Test {
@IsTest
static void inlcudesAll() {
// Setup
List<String> roles = new List<String>{ 'Business User', 'Decision Maker' };
List<String> ratings = new List<String>{ '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<String> roles = new List<String>{ 'Executive Sponsor', 'Economic Decision Maker' };
List<String> ratings = new List<String>{ '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<String> roles = new List<String>{ 'Technical Buyer', 'Economic Buyer' };
List<String> ratings = new List<String>{ '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<String> roles = new List<String>{ 'Evaluator', 'Influencer' };
List<String> ratings = new List<String>{ '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
Expand Down

1 comment on commit b8e7d34

@vercel
Copy link

@vercel vercel bot commented on b8e7d34 Aug 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.