Ejemplo n.º 1
0
        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")));
        }
Ejemplo n.º 2
0
        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")));
        }