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.
- Loading branch information
1 parent
c60ecc3
commit 3906e1a
Showing
3 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
framework/default/ortoo-core/default/classes/fflib-extension/caching/NullCache.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
45 changes: 45 additions & 0 deletions
45
framework/default/ortoo-core/default/classes/fflib-extension/caching/tests/NullCacheTest.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,45 @@ | ||
@isTest | ||
private without sharing class NullCacheTest | ||
{ | ||
@isTest | ||
private static void hasAccessToCache_whenCalled_returnsTrue() // NOPMD: Test method name format | ||
{ | ||
Boolean got = new NullCache().hasAccessToCache(); | ||
System.assertEquals( true, got, 'hasAccessToCache, when called, will return true' ); | ||
} | ||
|
||
@isTest | ||
private static void isACache_whenCalled_returnsFalse() // NOPMD: Test method name format | ||
{ | ||
Boolean got = new NullCache().isACache(); | ||
System.assertEquals( false, got, 'hasAccessToCache, when called, will return false' ); | ||
} | ||
|
||
@isTest | ||
private static void get_whenCalled_returnsNull() // NOPMD: Test method name format | ||
{ | ||
Object got = new NullCache().get( null ); | ||
System.assertEquals( null, got, 'get, when called, will return null' ); | ||
} | ||
|
||
@isTest | ||
private static void put_whenCalled_doesNothing() // NOPMD: Test method name format | ||
{ | ||
new NullCache().put( null, null, null ); | ||
System.assert( true, 'put, when called, will do nothing and not throw an exception' ); | ||
} | ||
|
||
@isTest | ||
private static void contains_whenCalled_returnsFalse() // NOPMD: Test method name format | ||
{ | ||
Boolean got = new NullCache().contains( null ); | ||
System.assertEquals( false, got, 'contains, when called, will return false' ); | ||
} | ||
|
||
@isTest | ||
private static void remove_whenCalled_doesNothing() // NOPMD: Test method name format | ||
{ | ||
new NullCache().remove( null ); | ||
System.assert( true, 'remove, when called, will do nothing and not throw an exception' ); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...fault/ortoo-core/default/classes/fflib-extension/caching/tests/NullCacheTest.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> |