예제 #1
0
        public async Task SimpleGetSnapshotAsync()
        {
            var s = new GreaterShare.BackgroundServices.Service.PicLibFolderScanService();

            var sn = await s.GetSnapshotAsync();

            Assert.IsNotNull(sn);
        }
예제 #2
0
        public async Task SimpleGetSnapshotAsync()
        {
            var s = new GreaterShare.BackgroundServices.Service.PicLibFolderScanService();

            var sn = await s.GetSnapshotAsync();

            Assert.IsNotNull(sn);
        }
예제 #3
0
        public async Task SimpleCompareSnapshotAsync()
        {
            var s = new GreaterShare.BackgroundServices.Service.PicLibFolderScanService();

            var sn = await s.GetSnapshotAsync();

            var lib = await Windows.Storage.StorageLibrary.GetLibraryAsync(Windows.Storage.KnownLibraryId.Pictures);

            var folder = lib.Folders[0];

            using (var file = await (await (await folder.GetFoldersAsync()).OfType<IStorageFolder>().Last().CreateFileAsync("ok.png", CreationCollisionOption.GenerateUniqueName)).OpenAsync(FileAccessMode.ReadWrite, StorageOpenOptions.None))
            {
              await  file.FlushAsync();
            }
            var sn2= await s.GetSnapshotAsync();

            var cr= s.CompareSnapshot(sn, sn2).OfType<Models.IPicLibFolder>();
            Assert.AreEqual ( cr.Count () ,2);
        }
예제 #4
0
        public async Task SimpleCompareSnapshotAsync()
        {
            var s = new GreaterShare.BackgroundServices.Service.PicLibFolderScanService();

            var sn = await s.GetSnapshotAsync();

            var lib = await Windows.Storage.StorageLibrary.GetLibraryAsync(Windows.Storage.KnownLibraryId.Pictures);

            var folder = lib.Folders[0];

            using (var file = await(await(await folder.GetFoldersAsync()).OfType <IStorageFolder>().Last().CreateFileAsync("ok.png", CreationCollisionOption.GenerateUniqueName)).OpenAsync(FileAccessMode.ReadWrite, StorageOpenOptions.None))
            {
                await file.FlushAsync();
            }
            var sn2 = await s.GetSnapshotAsync();

            var cr = s.CompareSnapshot(sn, sn2).OfType <Models.IPicLibFolder>();

            Assert.AreEqual(cr.Count(), 2);
        }