public void SgfNodeWithRepeatingPropertiesThrowsException() { var node = new SgfNode(new SgfProperty[] { new SgfProperty("FF", new [] { SgfNumberValue.Parse("4"), }), new SgfProperty("FF", new [] { SgfNumberValue.Parse("4") }), }); }
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 NegativeNumericValueIsProperlySerialized() { var propertyValue = new SgfNumberValue(-2353); Assert.AreEqual("-2353", propertyValue.Serialize()); }
public void NumericValueIsProperlySerialized() { var propertyValue = new SgfNumberValue(123); Assert.AreEqual("123", propertyValue.Serialize()); }
public void NumericValueWithLeadingZerosIsProperlyParsed() { var propertyValue = SgfNumberValue.Parse("-0004351"); Assert.AreEqual(-4351, propertyValue.Value); }
public void EmptyNumericValueParseThrows() { var propertyValue = SgfNumberValue.Parse(string.Empty); }
public void NegativeNumericValueIsProperlyParsed() { var propertyValue = SgfNumberValue.Parse("-24351"); Assert.AreEqual(-24351, propertyValue.Value); }
public void PositiveNumericValueIsProperlyParsed() { var propertyValue = SgfNumberValue.Parse("+211"); Assert.AreEqual(211, propertyValue.Value); }
public void SimpleNumericValueIsProperlyParsed() { var propertyValue = SgfNumberValue.Parse("1"); Assert.AreEqual(1, propertyValue.Value); }
public void ParsingNullNumberValueThrows() { SgfNumberValue.Parse(null); }