Пример #1
0
        public void LoadDatFile_Test()
        {
            IEnumerable <Translation> translations =
                SortedDatFileService.LoadDatFile(TEST_DATA_PATH_IN, new CultureInfo("en-GB"));

            Assert.IsNotNull(translations);
            Assert.IsTrue(translations.Any());
        }
Пример #2
0
        /// <summary>
        /// Imports a DAT file from a specified location.
        /// </summary>
        /// <param name="filePath">The path to the file to import.</param>
        /// <param name="locale">The locale of the file.</param>
        /// <param name="fileType">Type of dat file to import.</param>
        /// <returns></returns>
        /// <exception cref="ArgumentOutOfRangeException"></exception>
        public static IEnumerable <Translation> Import(string filePath, CultureInfo locale,
                                                       FileType fileType = FileType.SortedGameStringFile)
        {
            switch (fileType)
            {
            case FileType.SortedGameStringFile:
                return(SortedDatFileService.LoadDatFile(filePath, locale));

            case FileType.UnsortedCreditsStringFile:
                return(UnsortedDatFileService.LoadDatFile(filePath, locale));

            default:
                throw new ArgumentOutOfRangeException(nameof(fileType), fileType,
                                                      "The file type specified is not supported.");
            }
        }