コード例 #1
0
        public void Setup()
        {
            _log      = new Mock <ILog>();
            _settings = new Mock <IReadonlyRuntimeSettings>();
            _settings.Setup(x => x.SourceDirectory).Returns(FsPath.Empty);

            _sut = new CsharpScriptHandler(_log.Object);
            _sut.SetHostFromRuntimeSettings(_settings.Object);
            _loaded = _sut.LoadScripts(new FsPath(TestEnvironment.GetTestFolder()));
        }
コード例 #2
0
        private bool LoadAndCompileScripts()
        {
            if (_configuration == null)
            {
                return(false);
            }

            if (string.IsNullOrEmpty(_configuration.ScriptsDirectory))
            {
                return(true);
            }

            Log.Info("Trying to load and compile script files...");
            FsPath scripts = new FsPath(WorkDirectory).Combine(_configuration.ScriptsDirectory);

            int count = _scriptHandler.LoadScripts(scripts);

            Log.Info("Loaded {0} instances from script files", count);

            return(true);
        }