Пример #1
0
        public void NbtParser_ParseItem_ResultShouldBeString_Quoted()
        {
            // Arrange
            IStringReader reader = new StringReader("'foo bar baz'");

            // Act
            NbtReader.ReadItem(reader, out INbtArgument result);

            // Assert
            Assert.IsTrue(result is NbtString);
        }
Пример #2
0
        public void NbtParser_ParseItem_ResultShouldBeDouble()
        {
            // Arrange
            IStringReader reader = new StringReader("1.0");

            // Act
            NbtReader.ReadItem(reader, out INbtArgument result);

            // Assert
            Assert.IsTrue(result is NbtDouble);
        }
Пример #3
0
        public void NbtParser_ParseItem_EscapesStringCorrectly()
        {
            // Arrange
            IStringReader reader = new StringReader("'foo \\\'bar\\\' \\\\ baz'");

            // Act
            NbtReader.ReadItem(reader, out INbtArgument result);
            NbtString nbtString = result as NbtString;

            // Assert
            Assert.AreEqual(nbtString.ToString(), "foo 'bar' \\ baz");
        }