예제 #1
0
        public bool ResolveScriptExecutor(string className, string methodName)
        {
            // only for unit tests
            if (EntryPoint != null)
            {
                return(true);
            }

            var resolver = new EntryPointResolver
            {
                Log = Logger,
                ExecutorClassName  = className,
                ExecutorMethodName = methodName
            };

            EntryPoint = resolver.Resolve(Assembly);

            return(EntryPoint != null);
        }
        public void BeforeEachTest()
        {
            _logErrorOutput = new List <string>();

            var log = new Mock <ILogger>(MockBehavior.Strict);

            log
            .Setup(l => l.Info(It.IsAny <string>()))
            .Callback <string>(m =>
            {
                Console.WriteLine("Info: {0}", m);
            });
            log
            .Setup(l => l.Error(It.IsAny <string>()))
            .Callback <string>(m =>
            {
                Console.WriteLine("Error: {0}", m);
                _logErrorOutput.Add(m);
            });

            _sut = new EntryPointResolver {
                Log = log.Object
            };
        }