Beispiel #1
0
        public void TestSaveEmpty()
        {
            RemoveTestFile();

            NbtCompound expected = new NbtCompound();

            using (NbtWriter w = OpenTestFile())
                w.SaveTree(expected);

            NbtCompound loaded;

            using (NbtReader r = ReadTestFile())
                loaded = r.GetTree();

            Assert.AreEqual(expected, loaded);
        }
Beispiel #2
0
        public void TestSaveCompound()
        {
            NbtCompound expected = new NbtCompound();

            expected.Name = "RootCompound";
            expected.Attach(new NbtString {
                Name = "TestString", Value = "Test Value 123"
            });

            using (NbtWriter w = OpenTestFile())
                w.SaveTree(expected);

            NbtCompound loaded;

            using (NbtReader r = ReadTestFile())
                loaded = r.GetTree();

            Assert.AreEqual(expected, loaded);
        }