Beispiel #1
0
 public void SgfNodeWithRepeatingPropertiesThrowsException()
 {
     var node = new SgfNode(new SgfProperty[]
     {
         new SgfProperty("FF", new [] { SgfNumberValue.Parse("4"), }),
         new SgfProperty("FF", new [] { SgfNumberValue.Parse("4") }),
     });
 }
Beispiel #2
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>());
        }
Beispiel #3
0
        public void NumericValueWithLeadingZerosIsProperlyParsed()
        {
            var propertyValue = SgfNumberValue.Parse("-0004351");

            Assert.AreEqual(-4351, propertyValue.Value);
        }
Beispiel #4
0
 public void EmptyNumericValueParseThrows()
 {
     var propertyValue = SgfNumberValue.Parse(string.Empty);
 }
Beispiel #5
0
        public void NegativeNumericValueIsProperlyParsed()
        {
            var propertyValue = SgfNumberValue.Parse("-24351");

            Assert.AreEqual(-24351, propertyValue.Value);
        }
Beispiel #6
0
        public void PositiveNumericValueIsProperlyParsed()
        {
            var propertyValue = SgfNumberValue.Parse("+211");

            Assert.AreEqual(211, propertyValue.Value);
        }
Beispiel #7
0
        public void SimpleNumericValueIsProperlyParsed()
        {
            var propertyValue = SgfNumberValue.Parse("1");

            Assert.AreEqual(1, propertyValue.Value);
        }
Beispiel #8
0
 public void ParsingNullNumberValueThrows()
 {
     SgfNumberValue.Parse(null);
 }