21 Directory.Delete(compressionPath,
true);
27 string[] fileNames =
new string[]
32 "Something is going to happen with this one maybe.int",
36 string[] subpaths =
new string[]
43 string[,] fileContents =
new string[subpaths.Length, 5];
45 for (
int p = 0; p < subpaths.Length; p++)
47 string datapath = subpaths[p];
48 for (
int i = 0; i < 5; i++)
50 fileContents[p, i] = $
"{UnityEngine.Random.value}\n{UnityEngine.Random.value}";
52 Path.Combine(datapath, fileNames[i]),
61 inputPath: compressionPath,
62 outputFilePath: compressedFilePath);
67 Directory.Delete(compressionPath,
true);
73 inputFilePath: compressedFilePath,
74 outputPath: compressionPath);
79 for (
int p = 0; p < subpaths.Length; p++)
81 string datapath = subpaths[p];
82 for (
int i = 0; i < 5; i++)
84 Assert.IsTrue(File.Exists(Path.Combine(datapath, fileNames[i])));
85 string fileText = File.ReadAllText(Path.Combine(datapath, fileNames[i]));
86 Assert.IsTrue(fileContents[p, i] == fileText);
93 if (Directory.Exists(compressionPath))
95 Directory.Delete(compressionPath,
true);
101 if (File.Exists(compressedFilePath))
103 File.Delete(compressedFilePath);
static bool DecompressFile(string inputFilePath, string outputPath)
static bool CompressDirectory(string inputPath, string outputFilePath)
A collection of convenience methods to handle compression and decompression of zip files...
static string PathForDataSubDirectory(params string[] dataDirectories)
Returns the full path to the dataDirectories directory.
static string PathForDataFile(string dataDirectory, string fileName)
Returns the full path for specified datafile in a data directory