Ejemplo n.º 1
0
        public async Task Initialize()
        {
            this.accessList = new MockStorageItemAccessList();
            this.accessList.Add(
                new MockStorageFile {
                Name = "Some Metadata"
            },
                "Some Metadata"
                );

            this.accessList.Add(
                new MockStorageFile {
                Name = "Some more metadata"
            },
                "Some more metadata"
                );

            this.badFileToken = this.accessList.Add(
                null,
                "Bad"
                );

            this.accessList.Add(
                new MockStorageFile {
                Name = "A test file"
            },
                "A test file"
                );

            this.proxyFileName = "temp.txt";
            StorageFile proxy = await ApplicationData.Current.TemporaryFolder.CreateFileAsync(this.proxyFileName, CreationCollisionOption.OpenIfExists);

            this.accessList.Add(
                proxy.AsWrapper(),
                this.proxyFileName
                );

            this.proxyProvider = new FileProxyProvider(ApplicationData.Current.TemporaryFolder);
            IFileAccessService fileService = new MockFileService();

            this.promptingService = new MockUserPromptingService();
            this.viewModel        = new DashboardViewModel(
                this.accessList,
                new MockMotdProvider(),
                this.proxyProvider,
                new FileExportService(this.accessList, fileService),
                this.promptingService,
                this.promptingService,
                fileService
                );
        }
Ejemplo n.º 2
0
        public async Task Init()
        {
            StorageFolder rootFolder = ApplicationData.Current.TemporaryFolder;

            rootFolder = await rootFolder.CreateFolderAsync("Proxies", CreationCollisionOption.OpenIfExists);

            this.proxyProvider = new FileProxyProvider(rootFolder);
            Assert.AreEqual(0, (await rootFolder.GetFilesAsync()).Count, "Test should start with no proxies");

            IDatabaseAccessList accessList = new MockStorageItemAccessList();

            this.promptService = new MockUserPromptingService();
            IFileAccessService fileService = new MockFileService();

            this.viewModelFactory = new CachedFilesViewModelFactory(
                accessList,
                new FileExportService(accessList, fileService),
                this.proxyProvider,
                this.promptService,
                this.promptService,
                fileService
                );
        }