public void CopyDirectory_Recursive_DestHasAllContents() { CKAN.Utilities.CopyDirectory(goodKspDir, tempDir, true); Assert.IsTrue(UtilStatic.CompareFiles( Path.Combine(goodKspDir, "GameData", "README.md"), Path.Combine(tempDir, "GameData", "README.md"))); Assert.IsTrue(UtilStatic.CompareFiles( Path.Combine(goodKspDir, "buildID.txt"), Path.Combine(tempDir, "buildID.txt"))); Assert.IsTrue(UtilStatic.CompareFiles( Path.Combine(goodKspDir, "readme.txt"), Path.Combine(tempDir, "readme.txt"))); }
public void CopyDirectory_NotRecursive_DestHasOnlyFirstLevelFiles() { CKAN.Utilities.CopyDirectory(goodKspDir, tempDir, false); Assert.IsFalse(File.Exists(Path.Combine(tempDir, "GameData", "README.md"))); // The following assertion is per se already included in the above assertion, // but this also tests CompareFiles, so no harm in including this. Assert.IsFalse(UtilStatic.CompareFiles( Path.Combine(goodKspDir, "GameData", "README.md"), Path.Combine(tempDir, "GameData", "README.md"))); Assert.IsTrue(UtilStatic.CompareFiles( Path.Combine(goodKspDir, "buildID.txt"), Path.Combine(tempDir, "buildID.txt"))); Assert.IsTrue(UtilStatic.CompareFiles( Path.Combine(goodKspDir, "readme.txt"), Path.Combine(tempDir, "readme.txt"))); }