Ejemplo n.º 1
0
        public void FromJsonTest_InvalidJson()
        {
            string       json     = "Invalid";
            ValueByLevel expected = null;
            ValueByLevel result   = ValueByLevel.FromJson(json);

            Assert.AreEqual(expected, result);
        }
Ejemplo n.º 2
0
        public void FromJsonTest__IncompleteJson_NoNeededLevel()
        {
            string       json     = "{\"cooldown\":\"1200\", \"duration\":\"60\",\"formula\":\"STR\", \"interval\":\"1\"}";
            ValueByLevel expected = new ValueByLevel()
            {
                Cooldown = "1200", Duration = "60", Formula = "STR", Interval = "1", NeededLevel = 0
            };
            ValueByLevel result = ValueByLevel.FromJson(json);

            Assert.AreEqual(expected.Cooldown, result.Cooldown);
            Assert.AreEqual(expected.Duration, result.Duration);
            Assert.AreEqual(expected.Formula, result.Formula);
            Assert.AreEqual(expected.Interval, result.Interval);
            Assert.AreEqual(expected.NeededLevel, result.NeededLevel);
        }