Ejemplo n.º 1
0
        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: "));
            }
        }
Ejemplo n.º 2
0
        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);
        }