public void FileDelete_DoesNotExist_Succeeds() { var mockReader = Helper.GetMockReader(Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), 1); var delFile = new FileDelete(); delFile.ReadXml(mockReader.Object); Assert.IsTrue(delFile.Run()); }
public void FileDelete_Exists_Succeeds() { var cwd = Environment.CurrentDirectory; var tempFileName = Guid.NewGuid().ToString(); var tempFilePath = Path.Combine(cwd, tempFileName); var mockReader = Helper.GetMockReader(tempFilePath, Guid.NewGuid().ToString(), 1); var delFile = new FileDelete(); delFile.ReadXml(mockReader.Object); File.WriteAllText(tempFilePath, "to be deleted"); Assert.True(delFile.Run()); Assert.True(!Directory.Exists(tempFilePath)); }