2021-08-24 21:48:49 +08:00
|
|
|
using System.IO;
|
|
|
|
|
using System.IO.Compression;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using Xunit;
|
|
|
|
|
using Xunit.Abstractions;
|
|
|
|
|
|
|
|
|
|
namespace SharpNBT.Tests
|
|
|
|
|
{
|
|
|
|
|
public class ReadWriteTest
|
|
|
|
|
{
|
|
|
|
|
private readonly ITestOutputHelper output;
|
|
|
|
|
|
|
|
|
|
public ReadWriteTest(ITestOutputHelper output)
|
|
|
|
|
{
|
|
|
|
|
this.output = output;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void ReadUncompressed()
|
|
|
|
|
{
|
2021-08-25 08:31:13 +08:00
|
|
|
var compound = TestHelper.GetTag("hello_world.nbt", CompressionType.None);
|
2021-08-24 21:48:49 +08:00
|
|
|
output.WriteLine(compound.PrettyPrinted());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
public void ReadGZipped()
|
|
|
|
|
{
|
2021-08-25 08:31:13 +08:00
|
|
|
var compound = TestHelper.GetTag("bigtest.nbt", CompressionType.GZip);
|
2021-08-24 21:48:49 +08:00
|
|
|
output.WriteLine(compound.PrettyPrinted());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|