Exemplo n.º 1
0
        public void SaveLoadAttributeTest()
        {
            Error error    = null;
            var   fileName = "TestSave";
            var   dic      = Generator.GenerateCharakterAttributDictionary(Charakter.Attribute.UsedAttributs);

            foreach (var item in dic.Keys)
            {
                Charakter.Attribute.SetAttributAKTValue(item, dic[item], out error);
                ErrorHelper.ExpectErrorNull(error);
                var currentValue = Charakter.Attribute.GetAttributAKTValue(item, out error);
                ErrorHelper.ExpectErrorNull(error);
                Assert.AreEqual(dic[item], currentValue);
            }
            Charakter.Save(fileName, out error);
            ErrorHelper.ExpectErrorNull(error);
            Charakter_Load.Load(fileName, out error);
            ErrorHelper.ExpectErrorNull(error);

            foreach (var item in dic.Keys)
            {
                var currentValue = Charakter_Load.Attribute.GetAttributAKTValue(item, out error);
                ErrorHelper.ExpectErrorNull(error);
                Assert.AreEqual(dic[item], currentValue);
            }
        }