aboutsummaryrefslogtreecommitdiff
path: root/src/WixBuildTools.TestSupport/DisposableFileSystem.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixBuildTools.TestSupport/DisposableFileSystem.cs')
-rw-r--r--src/WixBuildTools.TestSupport/DisposableFileSystem.cs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/WixBuildTools.TestSupport/DisposableFileSystem.cs b/src/WixBuildTools.TestSupport/DisposableFileSystem.cs
index 28440f90..f096db72 100644
--- a/src/WixBuildTools.TestSupport/DisposableFileSystem.cs
+++ b/src/WixBuildTools.TestSupport/DisposableFileSystem.cs
@@ -1,4 +1,4 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. 1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2 2
3namespace WixBuildTools.TestSupport 3namespace WixBuildTools.TestSupport
4{ 4{
@@ -12,6 +12,13 @@ namespace WixBuildTools.TestSupport
12 12
13 private List<string> CleanupPaths { get; } = new List<string>(); 13 private List<string> CleanupPaths { get; } = new List<string>();
14 14
15 public bool Keep { get; }
16
17 public DisposableFileSystem(bool keep = false)
18 {
19 this.Keep = keep;
20 }
21
15 protected string GetFile(bool create = false) 22 protected string GetFile(bool create = false)
16 { 23 {
17 var path = Path.GetTempFileName(); 24 var path = Path.GetTempFileName();
@@ -56,7 +63,7 @@ namespace WixBuildTools.TestSupport
56 return; 63 return;
57 } 64 }
58 65
59 if (disposing) 66 if (disposing && !this.Keep)
60 { 67 {
61 foreach (var path in this.CleanupPaths) 68 foreach (var path in this.CleanupPaths)
62 { 69 {