AddAnySpellingExceptionsFromBackup() 공개 정적인 메소드

Used in restoring backups, copy the specified file, typically an exc, to the hunspell directory
Will not overwrite any existing files. Exceptions for vernacular dictionaries are wiped out when the dictionary is initialized.
public static AddAnySpellingExceptionsFromBackup ( string backupPath ) : void
backupPath string
리턴 void
예제 #1
0
        public void EnchantDictionaryMigrated()
        {
            // make temp folder with enchant dictionary in it
            var outputFolder = Path.Combine(Path.GetTempPath(), "EnchantDictionaryMigrationTestOut");
            var inputFolder  = Path.Combine(Path.GetTempPath(), "EnchantDictionaryMigrationTestIn");

            DirectoryUtilities.DeleteDirectoryRobust(outputFolder);
            DirectoryUtilities.DeleteDirectoryRobust(inputFolder);
            Directory.CreateDirectory(outputFolder);
            Directory.CreateDirectory(inputFolder);
            File.AppendAllText(Path.Combine(inputFolder, "test.dic"), "nil");
            File.AppendAllText(Path.Combine(inputFolder, "test.exc"), "nil");
            // SUT
            Assert.DoesNotThrow(() => SpellingHelper.AddAnySpellingExceptionsFromBackup(inputFolder, outputFolder));
            // Verify that the correct files were copied
            Assert.True(File.Exists(Path.Combine(outputFolder, "test.exc")), "The exception file should have been copied.");
            Assert.False(File.Exists(Path.Combine(outputFolder, "test.dic")), "The .dic file should not have been copied.");
        }