Пример #1
0
 public void TestGet()
 {
     con = JsonStore.Create(new ResourcesIO("LibUnity.DataStoreTest/environment"));
     Assert(con.Get <int>("test_config.var1") == 0, "get test_config.var1 is 0");
     Assert(con.Get <long>("test_config.var2") == 533157870896947200, "get test_config.var1 is 0");
     //Assert(con.Get<int>("test_config.var1") == 0, "get test_config.var1 is 0");
 }
Пример #2
0
        public void testSet()
        {
            con = JsonStore.Create(new ResourcesIO("LibUnity.DataStoreTest/environment"));
            con.Set <long>("test_config.var1", 10000);
            Assert(con.Get <long>("test_config.var1") == 10000, "get test_config.var1 is 10000");

            con.Set <long>("test_config.var2", 10);
            Assert(con.Get <long>("test_config.var2") == 10, "get test_config.var1 is 10000");
        }
Пример #3
0
 public void TestGetFailed()
 {
     con = JsonStore.Create(new ResourcesIO("LibUnity.DataStoreTest/environment"));
     Assert(!IsGetSuccess <string>(con, "test_config2.var"), "exception when wrong config name");
     Assert(IsGetSuccess <int>(con, "test_config.var1"), "success when valid type");
     Assert(!IsGetSuccess <string>(con, "test_config.var1"), "exception when wrong type");
     Assert(IsGetSuccess <double>(con, "test_config.var_float"), "success when cast enable type");
     Assert(!IsGetSuccess <float>(con, "test_config.var_float"), "exception when wrong type");
     Assert(!IsGetSuccess <string>(con, "test_config.var3333"), "exception when not exist path");
 }