Esempio n. 1
0
        public void SavesLoads_Data_Lists()
        {
            SetupTest();
            VSave.CreateSlot("test 1");
            VSave.ChooseSlot("test 1");

            List <string> keys = new List <string>()
            {
                "A", "B", "C", "D"
            };
            List <bool> inputs = new List <bool>()
            {
                false, true, false, true
            };

            VSave.Set("folder", keys, inputs);

            VSave.Save();
            VSave.Reset(true);

            VSave.LoadSlots();
            VSave.ChooseSlot("test 1");

            if (VSave.Get("folder", keys, out List <bool> outputs))
            {
                Assert.AreEqual(inputs, outputs);
            }
            else
            {
                Assert.Fail("Failed to get info.");
            }
        }
Esempio n. 2
0
        public void Creates_Slots_Folders_Exist()
        {
            SetupTest();

            VSave.CreateSlot("test 1");
            VSave.CreateSlot("test 2");
            VSave.CreateSlot("test 3");

            Assert.AreEqual(3, VSave.PhysicalSlotCount);
        }
Esempio n. 3
0
        public void Creates_Slots()
        {
            SetupTest();

            VSave.CreateSlot("test 1");
            VSave.CreateSlot("test 2");
            VSave.CreateSlot("test 3");

            Assert.AreEqual(3, VSave.SlotCount);
        }
Esempio n. 4
0
        //-------------------------------------------------------------------------
        // Unity API
        //-------------------------------------------------------------------------

        private new void Awake()
        {
            base.Awake();

            if (!initialized)
            {
                VSave.CreateSlot("temp");
                VSave.ChooseSlot("temp");
                initialized = true;
            }
        }
Esempio n. 5
0
        public void Deletes_Folder()
        {
            SetupTest();

            VSave.CreateSlot("test 1");
            VSave.CreateSlot("test 2");
            VSave.CreateSlot("test 3");

            VSave.Delete("test 1");

            Assert.AreEqual(2, VSave.SlotCount);
        }
Esempio n. 6
0
        public void Resets_Ignore_Folders_No_Slots_In_Memory()
        {
            SetupTest();

            VSave.CreateSlot("test 1");
            VSave.CreateSlot("test 2");
            VSave.CreateSlot("test 3");

            VSave.Reset(true);

            Assert.AreEqual(0, VSave.SlotCount);
        }
Esempio n. 7
0
        public void Resets_Delete_Folders_No_Physical_Folders()
        {
            SetupTest();

            VSave.CreateSlot("test 1");
            VSave.CreateSlot("test 2");
            VSave.CreateSlot("test 3");

            VSave.Reset();

            Assert.AreEqual(0, VSave.PhysicalSlotCount);
        }
Esempio n. 8
0
        public void Loads_Slots()
        {
            SetupTest();

            VSave.CreateSlot("test 1");
            VSave.CreateSlot("test 2");
            VSave.CreateSlot("test 3");

            VSave.Reset(true);

            VSave.LoadSlots();

            Assert.AreEqual(3, VSave.SlotCount);
        }
Esempio n. 9
0
        public void Loads_Saved_File()
        {
            SetupTest();

            VSave.CreateSlot("test 1");
            VSave.CreateSlot("test 2");
            VSave.CreateSlot("test 3");

            VSave.ChooseSlot("test 1");

            VSave.Set("test 1", "test 1", "test 1");

            VSave.Save();

            VSave.Reset(true);

            VSave.LoadSlots();

            VSave.ChooseSlot("test 1");
            VSave.Get <string>("test 1", "test 1");

            Assert.AreEqual(1, VSave.ActiveDataCount);
        }