-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathTestsBase.cs
More file actions
35 lines (30 loc) · 895 Bytes
/
TestsBase.cs
File metadata and controls
35 lines (30 loc) · 895 Bytes
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
namespace MsieJavaScriptEngine.Test.Common
{
public abstract class TestsBase
{
/// <summary>
/// Gets a JS engine mode
/// </summary>
protected abstract JsEngineMode EngineMode { get; }
/// <summary>
/// Gets a flag for whether to use the ECMAScript 5 Polyfill
/// </summary>
protected virtual bool UseEcmaScript5Polyfill => false;
/// <summary>
/// Gets a flag for whether to use the JSON2 library
/// </summary>
protected virtual bool UseJson2Library => false;
protected MsieJsEngine CreateJsEngine(bool allowReflection = false, bool enableDebugging = false)
{
var jsEngine = new MsieJsEngine(new JsEngineSettings
{
AllowReflection = allowReflection,
EnableDebugging = enableDebugging,
EngineMode = EngineMode,
UseEcmaScript5Polyfill = UseEcmaScript5Polyfill,
UseJson2Library = UseJson2Library
});
return jsEngine;
}
}
}