public void ShouldBeAbleToAddEnumToLibrary() { var luaStore = new LuaStore(); luaStore.AddLibrary("Apollo"); luaStore.AddEnum("Apollo", "Enum", null); var luaObject = luaStore.GetChild("Apollo").GetChild("Enum"); var val = luaObject as LuaEnum; Assert.That(val, Is.Not.Null); Assert.That(val.Name, Is.EqualTo("Enum")); }
public void ShouldBeAbleToAddEnumToLibrary() { var luaStore = new LuaStore(); luaStore.AddLibrary("Apollo"); luaStore.AddEnum("Apollo", "Enum", null); var luaObject = luaStore.GetChild("Apollo").GetChild("Enum"); var val = luaObject as LuaEnum; Assert.That(val, Is.Not.Null); Assert.That(val.Name, Is.EqualTo("Enum")); }
public void ShouldBeAbleToAddEnumWithValuesToLibrary() { var luaStore = new LuaStore(); luaStore.AddLibrary("Apollo"); luaStore.AddEnum( "Apollo", "Enum", new[] { new KeyValuePair<string, int>("Test1", 1), new KeyValuePair<string, int>("Test2", 2), new KeyValuePair<string, int>("Test3", 3) }); var luaObject = luaStore.GetChild("Apollo").GetChild("Enum"); var val = luaObject as LuaEnum; var values = val.GetValues(); Assert.That(values["Test1"], Is.EqualTo(1)); Assert.That(values["Test2"], Is.EqualTo(2)); Assert.That(values["Test3"], Is.EqualTo(3)); }
public void ShouldBeAbleToAddEnumWithValuesToLibrary() { var luaStore = new LuaStore(); luaStore.AddLibrary("Apollo"); luaStore.AddEnum( "Apollo", "Enum", new[] { new KeyValuePair <string, int>("Test1", 1), new KeyValuePair <string, int>("Test2", 2), new KeyValuePair <string, int>("Test3", 3) }); var luaObject = luaStore.GetChild("Apollo").GetChild("Enum"); var val = luaObject as LuaEnum; var values = val.GetValues(); Assert.That(values["Test1"], Is.EqualTo(1)); Assert.That(values["Test2"], Is.EqualTo(2)); Assert.That(values["Test3"], Is.EqualTo(3)); }