Ejemplo n.º 1
0
        public void PSample2()
        {
            KeyValue kv = KVTestHelper.Sample2(new PenguinParser());

            Assert.AreEqual(kv.Key, "Sample2");
            Assert.IsNotNull(kv["Key"]);
            Assert.AreEqual(kv["Key"].GetString(), "Value");
        }
Ejemplo n.º 2
0
        public void ASample1()
        {
            KeyValue kv = KVTestHelper.Sample1(new AderumParser());

            Assert.AreEqual(kv.Key, "SomeTest");
            Assert.IsNotNull(kv["Key"]);
            Assert.AreEqual(kv["Key"].GetString(), "Value");
        }
Ejemplo n.º 3
0
        public void PSample7()
        {
            KeyValue kv = KVTestHelper.Sample7(new PenguinParser());

            Assert.AreEqual(kv.Key, "DOTAAbilities");
            Assert.IsNotNull(kv["ninja_dash_fire"]);
            Assert.IsNotNull(kv["ninja_dash_fire"]["precache"]);
            Assert.AreEqual(kv["ninja_dash_fire"]["precache"].Children.Count(), 0);
        }
Ejemplo n.º 4
0
        public void PIssue3()
        {
            KeyValue kv = KVTestHelper.Issue3(new PenguinParser());

            Assert.AreEqual(kv.Key, "Issue3Test");

            Assert.IsNotNull(kv["Test"]);
            Assert.AreEqual(kv["Test"].GetString(), "Value");
        }
Ejemplo n.º 5
0
        public void PSample5()
        {
            //In this sample on line 128 there is a KeyValue pair without a space
            //between the key and the value.

            //Check that value and make sure it returns 50.

            KeyValue kv = KVTestHelper.Sample5(new PenguinParser());

            Assert.AreEqual("DOTAUnits", kv.Key);

            KeyValue SpecialKey = kv["npc_dota_creature_berserk_zombie"]["Creature"]["DefensiveAbilities"]["Ability1"];

            Assert.AreEqual(50, SpecialKey["UseAtHealthPercent"].GetInt());
        }
Ejemplo n.º 6
0
        public void PIssue1()
        {
            KeyValue kv = KVTestHelper.Issue1(new PenguinParser());

            Assert.AreEqual(kv.Key, "Issue1Test");
            Assert.IsNotNull(kv["Test"]);

            Assert.AreEqual(kv["Test"].GetString(), "5");
            Assert.AreEqual(kv["Test"].GetInt(), 5);

            Assert.IsNotNull(kv["Something"]);
            Assert.AreEqual(kv["Something"].GetString(), "asdf");

            Assert.IsNotNull(kv["Subkey"]);
            Assert.AreEqual(kv["Subkey"].Key, "Subkey");
            Assert.IsNotNull(kv["Subkey"]["Key"]);
            Assert.AreEqual(kv["Subkey"]["Key"].GetString(), "Value");
        }
Ejemplo n.º 7
0
        public void PSample4()
        {
            /* This sample was taken from the Dota 2 project sample for Holdout
             * It had an issue because on line 6 there is a key/value pair with a comment at the end, but not whitespace
             * betwen the comment and the end of the value.
             */
            KeyValue kv = KVTestHelper.Sample4(new PenguinParser());

            Assert.AreEqual(kv.Key, "npc_dota_holdout_tower");

            Assert.IsNotNull(kv["BaseClass"]);

            Assert.IsNotNull(kv["Model"]);
            Assert.AreEqual(kv["Model"].GetString(), "models/props_structures/tower_good.vmdl");

            Assert.IsNotNull(kv["SoundSet"]);
            Assert.AreEqual(kv["SoundSet"].GetString(), "Tower.Water");
        }
Ejemplo n.º 8
0
        public void PSample6()
        {
            KeyValue kv = KVTestHelper.Sample6(new PenguinParser());

            Assert.AreEqual("DOTAAbilities", kv.Key);
        }
Ejemplo n.º 9
0
 public void PSample8()
 {
     //Just a parsing test.
     KeyValue kv = KVTestHelper.Sample8(new PenguinParser());
 }