MakeSmallFile() публичный статический Метод

public static MakeSmallFile ( ) : NbtFile
Результат NbtFile
Пример #1
0
 public void PartialReadTest()
 {
     // read the whole thing as one tag
     TestFiles.AssertValueTest(PartialReadTestInternal(new NbtFile(TestFiles.MakeValueTest())));
     TestFiles.AssertNbtSmallFile(PartialReadTestInternal(TestFiles.MakeSmallFile()));
     TestFiles.AssertNbtBigFile(PartialReadTestInternal(new NbtFile(TestFiles.Big)));
 }
Пример #2
0
        public void TestNbtSmallFileSavingUncompressed()
        {
            NbtFile file         = TestFiles.MakeSmallFile();
            string  testFileName = Path.Combine(TestDirName, "test.nbt");

            file.SaveToFile(testFileName, NbtCompression.None);
            FileAssert.AreEqual(TestFiles.Small, testFileName);
        }
Пример #3
0
 public void PartialBatchReadTest()
 {
     // read the whole thing as one tag, in batches of 4 bytes
     // Verifies fix for https://github.com/fragmer/fNbt/issues/26
     TestFiles.AssertValueTest(PartialReadTestInternal(new NbtFile(TestFiles.MakeValueTest()), 4));
     TestFiles.AssertNbtSmallFile(PartialReadTestInternal(TestFiles.MakeSmallFile(), 4));
     TestFiles.AssertNbtBigFile(PartialReadTestInternal(new NbtFile(TestFiles.Big), 4));
 }
Пример #4
0
        public void TestNbtSmallFileSavingUncompressedStream()
        {
            NbtFile file      = TestFiles.MakeSmallFile();
            var     nbtStream = new MemoryStream();

            Assert.Throws <ArgumentNullException>(() => file.SaveToStream(null, NbtCompression.None));
            Assert.Throws <ArgumentException>(() => file.SaveToStream(nbtStream, NbtCompression.AutoDetect));
            Assert.Throws <ArgumentOutOfRangeException>(() => file.SaveToStream(nbtStream, (NbtCompression)255));
            file.SaveToStream(nbtStream, NbtCompression.None);
            FileStream testFileStream = File.OpenRead(TestFiles.Small);

            FileAssert.AreEqual(testFileStream, nbtStream);
        }