-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add NWNX VM tests. Fix NWNX function name marshalling.
- Loading branch information
1 parent
6b3e62d
commit af53f38
Showing
2 changed files
with
27 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using NUnit.Framework; | ||
|
||
namespace NWNX.NET.Tests | ||
{ | ||
[TestFixture(Category = "NWNX VM Tests")] | ||
public sealed class NWNXVMTests | ||
{ | ||
[Test] | ||
[TestCase("NWNX_Core", 1)] | ||
[TestCase("NWNX_DotNET", 1)] | ||
[TestCase("NWNX_SWIG_DotNET", 1)] | ||
[TestCase("NWNX_MissingPlugin", 0)] | ||
[TestCase("", 0)] | ||
[TestCase(null, 0, Ignore = "NWNX throws a std::logic_error")] | ||
public void PluginExistsTest(string plugin, int expectedResult) | ||
{ | ||
NWNXAPI.NWNXSetFunction("NWNX_Core", "PluginExists"); | ||
NWNXAPI.NWNXPushString(plugin); | ||
NWNXAPI.NWNXCallFunction(); | ||
|
||
int result = NWNXAPI.NWNXPopInt(); | ||
|
||
Assert.That(result, Is.EqualTo(expectedResult)); | ||
} | ||
} | ||
} |
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