forked from apex-enterprise-patterns/fflib-apex-common
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/filter-and-paging
- Loading branch information
Showing
72 changed files
with
3,169 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
framework/default/ortoo-core/default/classes/fflib-extension/tests/ortoo_CriteriaTest.cls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@isTest | ||
private without sharing class ortoo_CriteriaTest | ||
{ | ||
@isTest | ||
private static void likeString_field_whenCalled_addsALikeToTheGeneratedSoql() // NOPMD: Test method name format | ||
{ | ||
ortoo_Criteria criteria = new ortoo_Criteria(); | ||
|
||
Test.startTest(); | ||
criteria.likeString( Contact.Name, 'thing%' ); | ||
Test.stopTest(); | ||
|
||
String expected = 'Name LIKE \'thing%\''; | ||
String got = criteria.toSOQL(); | ||
|
||
System.assertEquals( expected, got, 'likeString, when called with a field, will add a LIKE to the Generated SOQL' ); | ||
} | ||
|
||
@isTest | ||
private static void likeString_stringName_whenCalled_addsALikeToTheGeneratedSoql() // NOPMD: Test method name format | ||
{ | ||
ortoo_Criteria criteria = new ortoo_Criteria(); | ||
|
||
Test.startTest(); | ||
criteria.likeString( 'Account.Name', 'thing%' ); | ||
Test.stopTest(); | ||
|
||
String expected = 'Account.Name LIKE \'thing%\''; | ||
String got = criteria.toSOQL(); | ||
|
||
System.assertEquals( expected, got, 'likeString, when called with a string name for a field will add a LIKE to the Generated SOQL' ); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
.../default/ortoo-core/default/classes/fflib-extension/tests/ortoo_CriteriaTest.cls-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<apiVersion>52.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
Oops, something went wrong.