public void OneTimeTearDown() { List <Package> packages = PackageDAO.Read(p => true).Result; packages.ForEach(p => { PackageDAO.Delete(p.Id); FileStore.DeleteFile(p.Id); }); }
private static void ClearAllPackages() { List <Package> packages = PackageDAO.Read(p => true).Result; packages.ForEach(p => { PackageDAO.Delete(p.Id); FileStore.DeleteFile(p.Id); }); }
/// <summary> /// Delete a file on a certain location /// </summary> /// <param name="folder">The name of the folder</param> /// <param name="fullName">The name of the file</param> public override void DeleteFile(string folder, string fullName) { try { FileStore.DeleteFile(FileStore.PathCombine(folder, fullName)); } catch (Exception ex) { Mvx.IoCProvider.Resolve <IMvxLog>().ErrorException("ExStorageService.DeleteFile", ex); } }
public async void ShouldDeleteFileCorrectly() { var fileMock = new Mock <IFile>(); var fsMock = new Mock <IFileSystem>(); fsMock .Setup(x => x.File) .Returns(fileMock.Object); var fileStore = new FileStore(fsMock.Object, BuildFakeConfiguration()); await fileStore.DeleteFile(new Guid("c55811c0-92ee-4346-902a-c302dddb7f9f")); fileMock.Verify(x => x.Delete($"datastore/c55811c0-92ee-4346-902a-c302dddb7f9f.file")); fileMock.VerifyNoOtherCalls(); }