|
6 | 6 | using System.Reflection;
|
7 | 7 | using System.Text;
|
8 | 8 | using System.Threading.Tasks;
|
| 9 | +using System.Xml.Linq; |
9 | 10 | using Microsoft.VisualStudio.TestTools.UnitTesting;
|
10 | 11 | using Neo.IronLua;
|
11 | 12 |
|
@@ -350,18 +351,20 @@ public void TestConvertStatic03()
|
350 | 351 | TestResult(new LuaResult(Lua.RtConvertValue(null, typeof(string))), "");
|
351 | 352 | TestResult(new LuaResult(Lua.RtConvertValue(new object(), typeof(string))), "System.Object");
|
352 | 353 |
|
353 |
| - TestResult(new LuaResult(Lua.RtConvertValue(1, typeof(Decimal))), 1m); |
354 |
| - TestResult(new LuaResult(Lua.RtConvertValue("1.2", typeof(Decimal))), 1.2m); |
| 354 | + TestResult(new LuaResult(Lua.RtConvertValue(1, typeof(decimal))), 1m); |
| 355 | + TestResult(new LuaResult(Lua.RtConvertValue("1.2", typeof(decimal))), 1.2m); |
355 | 356 | TestResult(new LuaResult(Lua.RtConvertValue(1.2m, typeof(string))), "1.2");
|
356 | 357 | TestResult(new LuaResult(Lua.RtConvertValue(1.2m, typeof(int))), 1);
|
357 | 358 |
|
358 | 359 | TestResult(new LuaResult(Lua.RtConvertValue("90238fad-cb41-4efa-bb2f-4d56a0088a01", typeof(Guid))), new Guid("90238fad-cb41-4efa-bb2f-4d56a0088a01"));
|
| 360 | + |
| 361 | + TestResult(new LuaResult(Lua.RtConvertValue(new XElement("test", new XText("value")), typeof(string))), "value"); |
359 | 362 | }
|
360 | 363 |
|
361 | 364 | [TestMethod]
|
362 | 365 | public void TestConvert04()
|
363 | 366 | {
|
364 |
| - using (Lua l = new Lua()) |
| 367 | + using (var l = new Lua()) |
365 | 368 | {
|
366 | 369 | l.PrintExpressionTree = Console.Out;
|
367 | 370 | dynamic g = l.CreateEnvironment();
|
|
0 commit comments