Beispiel #1
0
    public void TestNbtSmallFileSavingUncompressed()
    {
        NbtFile file         = TestFiles.MakeSmallFile();
        string  testFileName = Path.Combine(TestDirName, "test.nbt");

        file.SaveToFile(testFileName, NbtCompression.None);
        FileAssert.Equal(TestFiles.Small, testFileName);
    }
Beispiel #2
0
        public void SubtitleConverter(string inputExtension, string extension, string encoding = "utf-8")
        {
            var inputFilePath = Path.GetRelativePath(AppContext.BaseDirectory,
                                                     Path.Join(AppContext.BaseDirectory, "assets", inputExtension, $"in.{inputExtension}"));

            new SubtitleConverter(SubtitleLoader.FromFile(inputFilePath))
            .Convert(new OutputSubtitle(extension, encoding));

            var outputFilePath = Path.GetRelativePath(AppContext.BaseDirectory,
                                                      Path.Join(AppContext.BaseDirectory, "assets", inputExtension, $"in.{extension}"));
            var expectedFilePath = Path.GetRelativePath(AppContext.BaseDirectory,
                                                        Path.Join(AppContext.BaseDirectory, "assets", inputExtension, $"reference.{extension}"));

            FileAssert.Equal(expectedFilePath, outputFilePath);
        }