public void LuaCreateObject_ExtraDescriptions_Test()
        {
            var result = LuaObjectFunctions.LuaProcessObject(GetObjectLuaScript());

            Assert.That(result, Is.Not.Null);
            Assert.That(result.ExtraDescriptions.Count, Is.GreaterThanOrEqualTo(1));
            Assert.That(result.ExtraDescriptions.ToList().Find(x => x.Keyword.Equals("wand")), Is.Not.Null);
            Assert.That(result.ExtraDescriptions.ToList().Find(x => x.Keyword.Equals("pearl")), Is.Not.Null);
        }
        public void LuaCreateObject_MudProgs_Test()
        {
            var result = LuaObjectFunctions.LuaProcessObject(GetObjectLuaScript());

            Assert.That(result, Is.Not.Null);
            Assert.That(result.MudProgs.Count(), Is.EqualTo(1));
            Assert.That(result.MudProgs.First().Type, Is.EqualTo(MudProgTypes.Damage));
            Assert.That(result.MudProgs.First().ArgList, Is.EqualTo("100"));
            Assert.That(result.MudProgs.First().Script,
                        Is.EqualTo("local ch = GetLastCharacter();MPEcho(\"Testing\", ch);LObjectCommand(\"c fires $n\", ch);"));
        }
        public void LuaCreateObject_Values_Test()
        {
            var result = LuaObjectFunctions.LuaProcessObject(GetObjectLuaScript());

            Assert.That(result, Is.Not.Null);
            Assert.That(result.Values, Is.Not.Null);
            Assert.That(result.Values.Condition, Is.EqualTo(12));
            Assert.That(result.Values.NumberOfDice, Is.EqualTo(4));
            Assert.That(result.Values.SizeOfDice, Is.EqualTo(8));
            Assert.That(result.Values.WeaponType, Is.EqualTo(6));
        }
        public void LuaCreateObject_Affects_Test()
        {
            var result = LuaObjectFunctions.LuaProcessObject(GetObjectLuaScript());

            Assert.That(result, Is.Not.Null);
            Assert.That(result.Affects.Count, Is.GreaterThanOrEqualTo(1));
            Assert.That(result.Affects.ToList()[0].Type, Is.EqualTo(AffectedByTypes.None));
            Assert.That(result.Affects.ToList()[0].Duration, Is.EqualTo(-1));
            Assert.That(result.Affects.ToList()[0].Modifier, Is.EqualTo(60));
            Assert.That(result.Affects.ToList()[0].Location, Is.EqualTo(ApplyTypes.Hit));
            Assert.That(result.Affects.ToList()[0].BitVector.IsSet(32), Is.True);
        }
        public void LuaCreateObjectTest()
        {
            var result = LuaObjectFunctions.LuaProcessObject(GetObjectLuaScript());

            Assert.That(result, Is.Not.Null);
            Assert.That(result.ID, Is.EqualTo(800));
            Assert.That(result.Name, Is.EqualTo("pearl wand"));
            Assert.That(result.ShortDescription, Is.EqualTo("a pearl wand"));
            Assert.That(result.LongDescription, Is.EqualTo("The ground seems to cradle a pearl wand here."));
            Assert.That(result.Action, Is.EqualTo("blast"));
            Assert.That(result.Flags, Is.EqualTo("magic antigood antievil"));
            Assert.That(result.WearFlags, Is.EqualTo("take wield"));
            Assert.That(result.Spells.Count, Is.GreaterThanOrEqualTo(1));
            Assert.That(result.Spells.ToList()[0], Is.EqualTo("armor"));
            Assert.That(result.Weight, Is.EqualTo(1));
            Assert.That(result.Cost, Is.EqualTo(2500));
            Assert.That(result.Rent, Is.EqualTo(250));
            Assert.That(result.Level, Is.EqualTo(0));
            Assert.That(result.Layers, Is.EqualTo(0));
        }