public void SaveFileContentIsProperlySet() { DataStoreRegistry.AddStoreToRegistry <DataStoreMock>(); var store = SaveManager.Instance.GetDataStoreFor <DataStoreMock>(); var mock = new DataStoreElementMock(); mock.data.m_data = "Mockup of Store Data"; store.RegisterMockData(mock); var expectedJson = store.SerializeStoredData().ToString(); SaveManager.Instance.Save(); mock.data.m_data = "Overriding Value"; var changedJson = store.SerializeStoredData().ToString(); SaveManager.Instance.LoadStoresCacheFromSaveFile(true); var loadedJson = store.SerializeStoredData().ToString(); Assert.IsTrue(loadedJson == expectedJson && loadedJson != changedJson); SaveManager.Instance.DeleteSaveFileFromDisk(); }
public void DataStoreGetsProperlyRegistered() { DataStoreRegistry.AddStoreToRegistry <DataStoreMock>(); Assert.IsNotNull(SaveManager.Instance.GetDataStoreFor <DataStoreMock>()); }