Exemple #1
0
        public void KnownListPropertyValuesAreProperlyParsed()
        {
            var result =
                SgfPropertyValuesConverter.GetValues("AB", "aa", "bb", "cc").OfType <SgfPointRectangleValue>().ToList();

            Assert.AreEqual(3, result.Count);
            Assert.AreEqual("aa", result[0].Serialize());
            Assert.AreEqual("bb", result[1].Serialize());
            Assert.AreEqual("cc", result[2].Serialize());
        }
Exemple #2
0
        public void MadeUpPropertyValueIsUnknown()
        {
            var helloWorld = "Hello world";
            var result     = SgfPropertyValuesConverter.GetValues("MYMADEUPPROPERTY", helloWorld);
            var values     = result as ISgfPropertyValue[] ?? result.ToArray();

            Assert.IsTrue(values.First() is SgfUnknownValue);
            Assert.AreEqual(1, values.Count());
            Assert.AreEqual(helloWorld, values.First().Serialize());
        }
Exemple #3
0
 public void KnownPropertyWithWrongValueTypesParsingThrows()
 {
     SgfPropertyValuesConverter.GetValues("AB", "11", "22", "33").OfType <SgfPointRectangleValue>().ToList();
 }
Exemple #4
0
 public void NullPropertyValueThrows()
 {
     SgfPropertyValuesConverter.GetValues("C", null);
 }
Exemple #5
0
 public void NullPropertyIdentifierThrows()
 {
     SgfPropertyValuesConverter.GetValues(null, "someValue");
 }