public void TestInvalidType() { XmlElement invalidDef = Document("<array name='set'/>"); try { _parser.Parse(invalidDef, _context); } catch (StatErrorException e) { Assert.AreEqual(StaticError.InvalidType, e.Error); Assert.True(e.Message.StartsWith("The type array is not defined. Possible types: ")); } }
public void TestParse() { XmlElement unicodeDef = Document("<string name='message' charset='unicode'/>"); Assert.IsTrue(_parser.CanParse(unicodeDef, _context)); var unicode = (Scalar)_parser.Parse(unicodeDef, _context); AssertScalarField(unicode, FastType.Unicode, "message", null, "", DictionaryFields.Global, "message", Operator.None, ScalarValue.Undefined, false); }