Example #1
0
        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);
        }
Example #2
0
 public void RemoveFile(string path)
 {
     if (packageManagementEvents.OnFileRemoving(path))
     {
         FileService.DeleteFile(path);
     }
 }
 public bool OnFileRemoving(string path)
 {
     return(unsafeEvents.OnFileRemoving(path));
 }