Beispiel #1
0
        public async Task SaveAndDeletePocoWithAHandle()
        {
            var osh  = new ObjectStorageHelper <Poco>(StorageType.Local);
            var poco = new Poco();
            await osh.SaveAsync(poco, handle);

            await osh.DeleteAsync(handle);

            var result = await osh.LoadAsync(handle);

            Assert.AreEqual(result, default(Poco));
        }
Beispiel #2
0
        public async Task AttemptToLoadObjectUsingAHandleThatDoesNotExist()
        {
            //new up ObjectStorageHelper specifying that we want to interact with the Local storage folder
            var osh = new ObjectStorageHelper <Poco>(StorageType.Local);

            //First ensure that it does not exist
            await osh.DeleteAsync(handle);

            //Get the object from the storage folder
            var myPoco = await osh.LoadAsync(handle);

            Assert.AreEqual(null, myPoco);
        }
Beispiel #3
0
 public async Task Delete <T>()
 {
     var objectStorageHelper = new ObjectStorageHelper <T>(StorageType.Roaming);
     await objectStorageHelper.DeleteAsync();
 }
Beispiel #4
0
 public async Task Delete <T>()
 {
     var objectStorageHelper = new ObjectStorageHelper <T>(UsedStorageType);
     await objectStorageHelper.DeleteAsync();
 }