Ejemplo n.º 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") }),
     });
 }
Ejemplo n.º 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>());
        }
Ejemplo n.º 3
0
        public void NegativeNumericValueIsProperlySerialized()
        {
            var propertyValue = new SgfNumberValue(-2353);

            Assert.AreEqual("-2353", propertyValue.Serialize());
        }
Ejemplo n.º 4
0
        public void NumericValueIsProperlySerialized()
        {
            var propertyValue = new SgfNumberValue(123);

            Assert.AreEqual("123", propertyValue.Serialize());
        }
Ejemplo n.º 5
0
        public void NumericValueWithLeadingZerosIsProperlyParsed()
        {
            var propertyValue = SgfNumberValue.Parse("-0004351");

            Assert.AreEqual(-4351, propertyValue.Value);
        }
Ejemplo n.º 6
0
 public void EmptyNumericValueParseThrows()
 {
     var propertyValue = SgfNumberValue.Parse(string.Empty);
 }
Ejemplo n.º 7
0
        public void NegativeNumericValueIsProperlyParsed()
        {
            var propertyValue = SgfNumberValue.Parse("-24351");

            Assert.AreEqual(-24351, propertyValue.Value);
        }
Ejemplo n.º 8
0
        public void PositiveNumericValueIsProperlyParsed()
        {
            var propertyValue = SgfNumberValue.Parse("+211");

            Assert.AreEqual(211, propertyValue.Value);
        }
Ejemplo n.º 9
0
        public void SimpleNumericValueIsProperlyParsed()
        {
            var propertyValue = SgfNumberValue.Parse("1");

            Assert.AreEqual(1, propertyValue.Value);
        }
Ejemplo n.º 10
0
 public void ParsingNullNumberValueThrows()
 {
     SgfNumberValue.Parse(null);
 }