BadScript 2
Loading...
Searching...
No Matches
BadNUnitConsoleApi.cs
Go to the documentation of this file.
3
5
9[BadInteropApi("NUnit")]
10internal partial class BadNUnitConsoleApi
11{
16
17 private BadUnitTestContextBuilder Console => m_Console ?? throw new BadRuntimeException("Console Context not set");
18
20 {
21 m_Console = console;
22 }
23
24 [BadMethod(description: "Loads a Test File into the Unit Test Context")]
25 private void Load([BadParameter(description: "The file to be loaded.")] string file)
26 {
27 Console.Register(false, false, file);
28 }
29
30 [BadMethod(description: "Resets the Unit Test Context")]
31 private void Reset()
32 {
33 Console.Reset();
34 }
35
36 [BadMethod(description: "Adds a Test to the Unit Test Context")]
37 private void AddTest(
38 [BadParameter(description: "The Test Function")]
39 BadFunction func,
40 [BadParameter(description: "The Unit Test Name")]
41 string name,
42 [BadParameter(description: "Specifies if the runtime is allowed to compile the Function")]
43 bool allowCompile = true)
44 {
45 Console.AddTest(func, name, allowCompile);
46 }
47
48 [BadMethod(description: "Adds a Setup Function to the Unit Test Context")]
49 private void AddSetup([BadParameter(description: "The Setup Function")] BadFunction func)
50 {
51 Console.AddSetup(func);
52 }
53
54 private void AddTeardown([BadParameter(description: "The Teardown Function")] BadFunction func)
55 {
56 Console.AddTeardown(func);
57 }
58}
Implements the "NUnit" Api(Console Version)
void Load([BadParameter(description:"The file to be loaded.")] string file)
BadUnitTestContextBuilder? m_Console
The Console Context.
void AddTest([BadParameter(description:"The Test Function")] BadFunction func, [BadParameter(description:"The Unit Test Name")] string name, [BadParameter(description:"Specifies if the runtime is allowed to compile the Function")] bool allowCompile=true)
void AddTeardown([BadParameter(description:"The Teardown Function")] BadFunction func)
void AddSetup([BadParameter(description:"The Setup Function")] BadFunction func)
void SetContext(BadUnitTestContextBuilder console)
void AddSetup(BadFunction function)
Adds a Setup Function to the Test Context.
void AddTest(BadFunction function, BadObject testName, bool allowCompile=true)
Adds a Test Case to the Test Context.
void AddTeardown(BadFunction function)
Adds a Teardown Function to the Test Context.
void Register(bool optimizeFolding, bool optimizeSubstitution, params string[] files)
Registers one or multiple files to the Test Context.
Implements a function that can be called from the script.
Contains NUnit Extensions and APIs for the BadScript2 Runtime.
Definition BadNUnitApi.cs:7
Contains the Error Objects for the BadScript2 Language.
Contains Runtime Function Objects.