public void CanGetObjectValueTaskExecutor()
        {
            var type   = typeof(CommandExecutorProviderClassTest);
            var method = type.GetMethod(nameof(CommandExecutorProviderClassTest.ObjectValueTaskCommand));

            var moduleBuilderMock = new Mock <IModuleBuilder>();

            moduleBuilderMock.SetupGet(a => a.Type).Returns(type);

            var commandBuilderMock = new Mock <ICommandBuilder>();

            commandBuilderMock.SetupGet(a => a.IsAsync).Returns(true);
            commandBuilderMock.SetupGet(a => a.MethodInfo).Returns(method);
            commandBuilderMock.SetupGet(a => a.AsyncResultType).Returns(typeof(object));

            var moduleBuilder  = moduleBuilderMock.Object;
            var commandBuilder = commandBuilderMock.Object;

            var provider = new CommandExecutorProvider();

            var executor = provider.GetCommandExecutor(moduleBuilder, commandBuilder);

            Assert.NotNull(executor);
            Assert.IsType <ObjectValueTaskExecutor>(executor);
        }
Esempio n. 2
0
        public CommandFactoryTests()
        {
            var options          = new MariCommandsOptions();
            var parameterFactory = new ParameterFactory(options);
            var executorProvider = new CommandExecutorProvider();
            var factory          = new CommandFactory(options, parameterFactory, executorProvider);

            _factory = factory;
        }