Skip to content

Commit 091679b

Browse files
committed
Remove DebugSObject
1 parent 58d2161 commit 091679b

File tree

5 files changed

+14
-23
lines changed

5 files changed

+14
-23
lines changed

force-app/main/default/classes/function/DebugSObject.cls

Lines changed: 0 additions & 12 deletions
This file was deleted.

force-app/main/default/classes/function/DebugSObject.cls-meta.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.

force-app/main/default/classes/function/Fn.cls

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ public with sharing class Fn {
99
}
1010
}
1111

12-
public static DebugSObject Debug {
13-
get {
14-
return new DebugSObject();
15-
}
16-
}
17-
1812
public static MapToSObject MapTo(Schema.SObjectType type) {
1913
return new MapToSObject(type);
2014
}

force-app/main/default/classes/test/classes/function/MapToSObjectTest.cls

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ private class MapToSObjectTest {
4646
System.Assert.areEqual(accountId, task.WhatId);
4747
}
4848

49+
@IsTest
50+
private static void testMapFieldNameWithRelation() {
51+
Id accountId = TestUtility.getFakeId(Account.SObjectType);
52+
Opportunity opp = new Opportunity(Account = new Account(Id = accountId));
53+
Task task = (Task) new MapToSObject(Task.SObjectType).mapField('WhatId', 'Account.Id').call(opp);
54+
System.Assert.areEqual(accountId, task.WhatId);
55+
}
56+
4957
@IsTest
5058
private static void testMapFieldsWithFields() {
5159
Opportunity opp = new Opportunity(Description = 'Test', Amount = 500);

force-app/main/default/classes/test/classes/function/MatchFieldsTest.cls

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,10 @@ private class MatchFieldsTest {
5050
System.Assert.isTrue(new MatchFields().field(Opportunity.Name).isIn(new Set<String>{'foo'}).call(new Opportunity(Name = 'foo')));
5151
System.Assert.isFalse(new MatchFields().field(Opportunity.Name).isIn(new Set<String>{'foo'}).call(new Opportunity(Name = 'bar')));
5252
}
53+
54+
@IsTest
55+
static void containsString() {
56+
System.Assert.isTrue(new MatchFields().field(Opportunity.Name).isIn(new Set<String>{'foo'}).call(new Opportunity(Name = 'foo')));
57+
System.Assert.isFalse(new MatchFields().field(Opportunity.Name).isIn(new Set<String>{'foo'}).call(new Opportunity(Name = 'bar')));
58+
}
5359
}

0 commit comments

Comments
 (0)