forked from cesarParra/expression
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvaluatorCustomContextCacheTest.cls
More file actions
35 lines (30 loc) · 1.14 KB
/
Copy pathEvaluatorCustomContextCacheTest.cls
File metadata and controls
35 lines (30 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
@IsTest
private class EvaluatorCustomContextCacheTest {
@IsTest
static void standardFunctionCacheDisabled_doesNotReuseFirstCustomContext() {
Configuration config1 = new Configuration();
config1.cacheStandardFunctionResults = false;
config1.customContext = new Map<String, Object>{
'value' => 'first'
};
Configuration config2 = new Configuration();
config2.cacheStandardFunctionResults = false;
config2.customContext = new Map<String, Object>{
'value' => 'second'
};
Test.startTest();
Object firstResult = Evaluator.run('UPPER(@value)', config1);
Object secondResult = Evaluator.run('UPPER(@value)', config2);
Test.stopTest();
System.assertEquals(
'FIRST',
firstResult,
'First evaluation must use the first customContext, not cached result from first run.'
);
System.assertEquals(
'SECOND',
secondResult,
'Second evaluation must use the second customContext, not cached result from first run.'
);
}
}