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); }
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); }
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"); }