Ejemplo n.º 1
0
        public void StringWithEscapedNewlinesCanBeParsed()
        {
            var propertyValue = SgfTextValue.Parse("Hello,\\\r world.");

            Assert.AreEqual(
                $"Hello, world.",
                propertyValue.Value);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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>());
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        public void SimpleStringWithWhitespaceCanBeParsed()
        {
            var propertyValue = SgfTextValue.Parse("Hello,\t world.");

            Assert.AreEqual("Hello,  world.", propertyValue.Value);
        }
Ejemplo n.º 6
0
 public void NullValueCannotBeParsed()
 {
     SgfTextValue.Parse(null);
 }