Note that this project should be considered deprecated. While I'm leaving it here for the moment, it will likely be removed from the repository in future.
Console.WriteLine("Test failed!!! Should have thrown an exception all the way out of Lua");
}
catch(LuaExceptione)
{
Console.WriteLine("Event exception success");
}
}
publicvoidTestExceptionWithChunkOverload()
{
Init();
try
{
_Lua.DoString("thiswillthrowanerror","MyChunk");
}
catch(Exceptione)
{
if(e.Message.StartsWith("[string \"MyChunk\"]"))
Console.WriteLine("Chunk overload passed");
else
Console.WriteLine("Chunk overload failed");
}
}
publicvoidTestGenerics()
{
Init();
//Im not sure support for generic classes is possible to implement, see: http://msdn.microsoft.com/en-us/library/system.reflection.methodinfo.containsgenericparameters.aspx
//specifically the line that says: "If the ContainsGenericParameters property returns true, the method cannot be invoked"
//TestClassGeneric<string> genericClass = new TestClassGeneric<string>();
if(!classWithGenericMethod.GenericMethodSuccess||!classWithGenericMethod.Validate<double>(100))//note the gotcha: numbers are all being passed to generic methods as doubles