public void Storage_ThrowsArgumentNullException() { Assert.Throws <ArgumentNullException>(() => { var storage = new PlayerPrefsStorage(null); }); }
public StorageService(StorageType storageType) { switch (storageType) { case StorageType.PlayerPrefs: StorageInstance = PlayerPrefsStorage.GetInstance(); Api = new PlayerPrefsApi(); break; case StorageType.FileStorage: StorageInstance = FileStorageStorage.GetInstance(); Api = new FileStorageApi(); break; case StorageType.InMemory: StorageInstance = InMemoryStorage.GetInstance(); Api = new InMemoryStorageApi(); break; default: throw new ArgumentOutOfRangeException(nameof(storageType), storageType, null); } OnChangeValue += StorageInstance.OnKeyValueUpdated; }
private IUserProfileModel GetUserProfileModel() { IUserProfileModel userProfileModel = new UserProfileModel(); IStorage storage = new PlayerPrefsStorage(); storage.Converter = new JSONConverter(); userProfileModel.Storage = storage; userProfileModel.LoadUserProfile(); userProfileModel.CurrentCity = "Minsk"; return(userProfileModel); }