public void TestDataBase(TestDataBase obj) { Assert.IsNotNull(obj); Assert.AreEqual(123, obj.int_val); Assert.AreEqual(4.56789, obj.float_val); Assert.AreEqual(TestStr, obj.str_val); Assert.AreEqual(true, obj.bool_val); }
public void TestToLuaBase() { var data = new TestDataBase(); data.int_val = 1; data.float_val = 2.34; data.str_val = TestStr; data.bool_val = true; var str = LuaUtility.ToLua(data); Assert.IsNotNull(str); Assert.IsTrue(str.Contains("int_val = 1,")); Assert.IsTrue(str.Contains("float_val = 2.34,")); Assert.IsTrue(str.Contains("str_val = \"" + TestStr)); Assert.IsTrue(str.Contains("bool_val = true,")); }