summaryrefslogtreecommitdiff
path: root/src/internal/WixBuildTools.TestSupport/TestDataFolderFileSystem.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2022-11-08 14:58:05 -0800
committerRob Mensching <rob@firegiant.com>2022-11-08 16:20:25 -0800
commitc843b47d6233153fa961c6d0e61edf7cedf255bb (patch)
tree9eae6badd42d3badb8665b7414b4d44ca48d6ae1 /src/internal/WixBuildTools.TestSupport/TestDataFolderFileSystem.cs
parent7e498d6348c26583972ea1cdf7d51dadc8f5b792 (diff)
downloadwix-c843b47d6233153fa961c6d0e61edf7cedf255bb.tar.gz
wix-c843b47d6233153fa961c6d0e61edf7cedf255bb.tar.bz2
wix-c843b47d6233153fa961c6d0e61edf7cedf255bb.zip
Separate WixInternal content from official WixToolset namespace
Diffstat (limited to 'src/internal/WixBuildTools.TestSupport/TestDataFolderFileSystem.cs')
-rw-r--r--src/internal/WixBuildTools.TestSupport/TestDataFolderFileSystem.cs42
1 files changed, 0 insertions, 42 deletions
diff --git a/src/internal/WixBuildTools.TestSupport/TestDataFolderFileSystem.cs b/src/internal/WixBuildTools.TestSupport/TestDataFolderFileSystem.cs
deleted file mode 100644
index 15b7631d..00000000
--- a/src/internal/WixBuildTools.TestSupport/TestDataFolderFileSystem.cs
+++ /dev/null
@@ -1,42 +0,0 @@
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
3namespace WixBuildTools.TestSupport
4{
5 using System;
6
7 /// <summary>
8 /// This class builds on top of DisposableFileSystem
9 /// to make it easy to write a test that needs a whole folder of test data copied to a temp location
10 /// that will automatically be cleaned up at the end of the test.
11 /// </summary>
12 public class TestDataFolderFileSystem : IDisposable
13 {
14 private DisposableFileSystem fileSystem;
15
16 public string BaseFolder { get; private set; }
17
18 public void Dispose()
19 {
20 this.fileSystem?.Dispose();
21 }
22
23 public void Initialize(string sourceDirectoryPath)
24 {
25 if (this.fileSystem != null)
26 {
27 throw new InvalidOperationException();
28 }
29 this.fileSystem = new DisposableFileSystem();
30
31 this.BaseFolder = this.fileSystem.GetFolder();
32
33 RobocopyFolder(sourceDirectoryPath, this.BaseFolder);
34 }
35
36 public static ExternalExecutableResult RobocopyFolder(string sourceFolderPath, string destinationFolderPath)
37 {
38 var args = $"\"{sourceFolderPath}\" \"{destinationFolderPath}\" /E /R:1 /W:1";
39 return RobocopyRunner.Execute(args);
40 }
41 }
42}