public void Execute_PackagesConfigFileDeletedDuringInstall_FileServicePackagesConfigFileDeletionIsCancelled() { CreateAction(); string expectedFileName = @"d:\projects\MyProject\packages.config".ToNativePath(); bool? fileRemovedResult = null; packageManager.BeforeExecuteAction = () => { fileRemovedResult = packageManagementEvents.OnFileRemoving(expectedFileName); }; action.Execute(); Assert.AreEqual(expectedFileName, fileRemover.FileRemoved); Assert.IsFalse(fileRemovedResult.Value); }
public void RemoveFile(string path) { if (packageManagementEvents.OnFileRemoving(path)) { FileService.DeleteFile(path); } }
public bool OnFileRemoving(string path) { return(unsafeEvents.OnFileRemoving(path)); }