Пример #1
0
        public void SharedTypeTest()
        {
            var saver = new DataSaver(DataSaver.DataLocation.UserData);

            saver.Save("alpha_1", 123);
            saver.Save("alpha_2", 321);
            saver.Save("alpha_3", new string[] { "sadas,", "asdsad::" });
            saver.Save("alpha_4", "asdasdas");
            saver.Save("alpha_5", new TestModel("asd", 1232));

            Assert.AreEqual(saver.GetSavedObject <int>("alpha_1"), 123, "(test 1 - number)");
            Assert.AreEqual(saver.GetSavedObject <int>("alpha_2"), 321, "(test 2 - number)");
            Assert.IsTrue(saver.GetSavedArray <string>("alpha_3").SequenceEqual(new string[] { "sadas,", "asdsad::" }), "(test 3 - array)");
            Assert.AreEqual(saver.GetSavedObject <string>("alpha_4"), "asdasdas", "(test 4 - string)");
            Assert.AreEqual(saver.GetSavedObject <TestModel>("alpha_5"), new TestModel("asd", 1232), "(test 5 - class)");
        }