File tree Expand file tree Collapse file tree 5 files changed +14
-23
lines changed
force-app/main/default/classes Expand file tree Collapse file tree 5 files changed +14
-23
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff 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 );
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments