public void ResolveFromExample()
        {
            _sut.ExecutorClassName  = nameof(ExampleSqlDatabaseScript);
            _sut.ExecutorMethodName = nameof(ExampleSqlDatabaseScript.Execute);

            var actual = _sut.Resolve(GetType().Assembly);

            CollectionAssert.IsEmpty(_logErrorOutput);
            Assert.IsInstanceOf <DefaultEntryPoint>(actual);

            var entryPoint = (DefaultEntryPoint)actual;

            Assert.IsNotNull(entryPoint.Log);
            Assert.IsInstanceOf <ExampleSqlDatabaseScript>(entryPoint.ScriptInstance);
            Assert.AreEqual(nameof(ExampleSqlDatabaseScript.Execute), entryPoint.Method.Method.Name);
        }
Exemplo n.º 2
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);
        }