public void DeletesFileFromFileSystem()
            {
                var file = new PlatformFile(this.platformFile);

                file.Delete();
                AssertEx.Throws <FileNotFoundException>(() => FileSystemTest.GetPlatformFile(FileSystemTest.GetPlatformFileName(this.platformFile)));
            }
Example #2
0
            public void RecreatesFolderIfItWasDeleted()
            {
                var folder = new PlatformFolder(this.storageFolder);

                FileSystemTest.DeletePlatformItem(this.storageFolder);
                string fileName = GetUniqueFileName();

                folder.CreateFile(fileName);
                Assert.IsNotNull(FileSystemTest.GetPlatformFile(fileName, this.storageFolder));
            }
Example #3
0
            public void CreatesPhysicalFileInFileSystem()
            {
                var folder = new PlatformFolder(this.storageFolder);

                string        fileName = GetUniqueFileName();
                IPlatformFile file     = folder.CreateFile(fileName);

                var storageFile = FileSystemTest.GetPlatformFile(fileName, this.storageFolder);

                Assert.IsNotNull(storageFile);
            }
            public void RenamesFileInFileSystem()
            {
                var    file    = new PlatformFile(this.platformFile);
                string oldName = GetPlatformFileName(this.platformFile);
                string newName = Guid.NewGuid().ToString("N");

                file.Rename(newName);

                AssertEx.Throws <FileNotFoundException>(() => FileSystemTest.GetPlatformFile(oldName));
                Assert.IsNotNull(FileSystemTest.GetPlatformFile(newName));
            }