Commit 2722c72e authored by Vlad Soroka's avatar Vlad Soroka Committed by Vinicius Jarina
Browse files

Adding UT

parent 135495f2
......@@ -198,6 +198,13 @@ namespace NLuaTest
lua.DoString("i = test:MethodOverload(2,2)\r\nprint(i)");
int i = (int) lua.GetNumber("i");
Assert.AreEqual(5, i, "#1");
lua.DoString("v = test:MethodOverload2(11)");
var value = lua.GetString("v");
Assert.AreEqual("uint32:11", value, "#2");
lua.DoString("v = test:MethodOverload2('321')");
value = lua.GetString("v");
Assert.AreEqual("string:321", value, "#3");
}
}
......
......@@ -296,6 +296,20 @@ namespace NLuaTest.TestTypes
Console.WriteLine("Overload with out param" + i + ", " + j);
}
public string MethodOverload2(uint i)
{
Console.WriteLine("Overload with uint32 param: " + i );
return $"uint32:{i}";
}
public string MethodOverload2(string i)
{
Console.WriteLine("Overload with numeric string param: " + i);
return $"string:{i}";
}
public void Print(object format, params object[] args)
{
//just for test,this is not printf implements
......
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