コード例 #1
0
        public void field_not_defined()
        {
            var target = new FieldAccessExpression
            {
                FieldName = new IdentifierNode {
                    Name = "Foo"
                },
                Target = new StringLiteralExpression("abc")
            };
            AstHelper helper = Mother.CreateRuntime();

            try
            {
                target.Compile(helper);
            }
            catch (SemanticException e)
            {
                var error = e.Errors.First() as FieldNotFoundError;
                Assert.IsNotNull(error);
                Assert.Pass();
            }
            Assert.Fail();
        }