Пример #1
0
        public void Catch_VBNet_rule_compile_error()
        {
            var good_script = new ScriptSourceElement()
            {
                Name       = "good",
                Type       = ScriptSourceElementType.Rule,
                SourceCode = @"
logger.Log(""Test"");
"
            };
            var bad_script = new ScriptSourceElement()
            {
                Name       = "bad",
                Type       = ScriptSourceElementType.Rule,
                SourceCode = @"
loger.Log(""Test"");
"
            };
            var logger  = Substitute.For <ILogEvents>();
            var library = Substitute.For <IScriptLibrary>();
            var engine  = new VBNetScriptEngine(logger, Debugger.IsAttached, library);

            engine.Load(new ScriptSourceElement[] { good_script, bad_script });

            logger.Received().ScriptHasError("bad", 2, 0, "BC30451", "'loger' is not declared. It may be inaccessible due to its protection level.");
        }
Пример #2
0
        public void Catch_VBNet_rule_compile_error()
        {
            string good_script = @"
logger.Log(""Test"")
";
            string bad_script  = @"
loger.Log(""Test"")
";
            var    logger      = Substitute.For <ILogEvents>();
            var    engine      = new VBNetScriptEngine(logger, Debugger.IsAttached);

            engine.Load("good", good_script);
            engine.Load("bad", bad_script);
            engine.LoadCompleted();

            logger.Received().ScriptHasError("bad", 2, 0, "BC30451", "'loger' is not declared. It may be inaccessible due to its protection level.");
        }
Пример #3
0
        public void Catch_VBNet_rule_compile_error()
        {
            string good_script = @"
logger.Log(""Test"")
";
            string bad_script = @"
loger.Log(""Test"")
";
            var logger = Substitute.For<ILogEvents>();
            var engine = new VBNetScriptEngine(logger, Debugger.IsAttached);

            engine.Load("good", good_script);
            engine.Load("bad", bad_script);
            engine.LoadCompleted();

            logger.Received().ScriptHasError("bad", 2, 0, "BC30451", "'loger' is not declared. It may be inaccessible due to its protection level.");
        }