Commit be5ea9b0 authored by Eonstorm's avatar Eonstorm
Browse files

Corrected the ThrowException test to check the proper exception message.

Reference Issue 21.


git-svn-id: http://luainterface.googlecode.com/svn/trunk@16 63eb109e-e254-0410-a61e-ed0b8f8614f5
parent c5849187
...@@ -980,7 +980,11 @@ namespace LuaInterface.Tests ...@@ -980,7 +980,11 @@ namespace LuaInterface.Tests
bool err = (bool)_Lua["err"]; bool err = (bool)_Lua["err"];
Exception errMsg = (Exception)_Lua["errMsg"]; Exception errMsg = (Exception)_Lua["errMsg"];
TestOk(!err); TestOk(!err);
TestOk("exception test" == errMsg.Message); TestOk(errMsg.InnerException != null);
if (errMsg.InnerException != null)
{
TestOk("exception test" == errMsg.InnerException.Message);
}
//Console.WriteLine("interface returned: "+errMsg.ToString()); //Console.WriteLine("interface returned: "+errMsg.ToString());
Destroy(); Destroy();
...@@ -1294,7 +1298,7 @@ namespace LuaInterface.Tests ...@@ -1294,7 +1298,7 @@ namespace LuaInterface.Tests
{ {
_Lua.DoString("thiswillthrowanerror", "MyChunk"); _Lua.DoString("thiswillthrowanerror", "MyChunk");
} }
catch(Exception e) catch (Exception e)
{ {
if (e.Message.StartsWith("[string \"MyChunk\"]")) if (e.Message.StartsWith("[string \"MyChunk\"]"))
Console.WriteLine("Chunk overload passed"); Console.WriteLine("Chunk overload passed");
...@@ -1358,7 +1362,7 @@ namespace LuaInterface.Tests ...@@ -1358,7 +1362,7 @@ namespace LuaInterface.Tests
if (!classWithGenericMethod.GenericMethodSuccess || (classWithGenericMethod.PassedValue as TestClass).val != 56) if (!classWithGenericMethod.GenericMethodSuccess || (classWithGenericMethod.PassedValue as TestClass).val != 56)
passed = false; passed = false;
if(passed) if (passed)
Console.WriteLine("Class with generic method passed"); Console.WriteLine("Class with generic method passed");
else else
Console.WriteLine("Class with generic method failed"); Console.WriteLine("Class with generic method failed");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment