public void StringWithEscapedNewlinesCanBeParsed() { var propertyValue = SgfTextValue.Parse("Hello,\\\r world."); Assert.AreEqual( $"Hello, world.", propertyValue.Value); }
public void StringWithNewlinesCanBeParsed() { var propertyValue = SgfTextValue.Parse("Hello,\r \n \r\n \n\rworld."); Assert.AreEqual( $"Hello,{Environment.NewLine} {Environment.NewLine} {Environment.NewLine} {Environment.NewLine}world.", propertyValue.Value); }
public void ValidSgfNodeWithPropertiesCanBeCreated() { var node = new SgfNode(new [] { new SgfProperty("FF", new [] { SgfNumberValue.Parse("4") }), new SgfProperty("C", new [] { SgfTextValue.Parse("Test") }) }); Assert.AreEqual(2, node.Count()); Assert.AreEqual("FF", node["FF"].Identifier); Assert.AreEqual(4, node["FF"].Value <int>()); Assert.AreEqual("C", node["C"].Identifier); Assert.AreEqual("Test", node["C"].Value <string>()); }
public void MoreComplexTextIsProperlyParsed() { var actualValue = @"Meijin NR: yeah, k4 is won\ derful sweat NR: thank you! :\) dada NR: yup. I like this move too. It's a move only to be expected from a pro. I really like it :) jansteen 4d: Can anyone\ explain [me\] k4?"; var expected = @"Meijin NR: yeah, k4 is wonderful sweat NR: thank you! :) dada NR: yup. I like this move too. It's a move only to be expected from a pro. I really like it :) jansteen 4d: Can anyone explain [me] k4?"; var propertyValue = SgfTextValue.Parse(actualValue); var actual = propertyValue.Value; TestUtilities.AssertStringEqualityByCharacters(expected, actual); }
public void SimpleStringWithWhitespaceCanBeParsed() { var propertyValue = SgfTextValue.Parse("Hello,\t world."); Assert.AreEqual("Hello, world.", propertyValue.Value); }
public void NullValueCannotBeParsed() { SgfTextValue.Parse(null); }