public CachedMethodExecutor(IMethodExecutor methodExecutor, Type staticClass, Type target, List <Type> argumentTypes) { _methodExecutor = methodExecutor; _staticClass = staticClass; _target = target; _argumentTypes = argumentTypes; }
public ExecuteStepProcessor(IStepRegistry stepRegistry, IMethodExecutor methodExecutor, ISandbox sandbox) { _stepRegistry = stepRegistry; _methodExecutor = methodExecutor; _sandbox = sandbox; InitializeConverter(); }
protected HookExecutionProcessor(IMethodExecutor methodExecutor, IAssemblyLoader assemblyLoader, IReflectionWrapper reflectionWrapper) { _messageCollectorType = assemblyLoader.GetLibType(LibType.MessageCollector); MethodExecutor = methodExecutor; _reflectionWrapper = reflectionWrapper; Strategy = new HooksStrategy(); }
public static TDelegate Wrap <TDelegate>(this IMethodExecutor executor, object target) => (TDelegate)_caches.GetOrAdd(executor, exec => { var method = exec.MethodInfo; var parameters = exec.MethodParameters.Select(p => Expression.Parameter(p.ParameterType)).ToArray(); var invoke = Expression.Call(Expression.Constant(target), method, parameters); var runner = method.ReturnType == typeof(void) ? (Expression)Expression.Block(invoke) : Expression.Convert(invoke, method.ReturnType); return(Expression.Lambda <TDelegate>(runner, parameters).Compile()); });
public RpcBindingHost(IConnection <TMarshal> connection, IPlatformBinder <TMarshal> parameterBinder, IScheduler baseScheduler) { this.connection = connection; bindingRepository = new BindingRepository(new IntIdGenerator()); if (baseScheduler is IDisposable disposable) { disposables.Add(disposable); } // ReSharper disable once InvokeAsExtensionMethod var baseMessages = Observable.ObserveOn(connection, baseScheduler); callbackExecutor = new CallbackExecutor <TMarshal>(new IntIdGenerator(), connection, baseMessages.Select(m => m.CallbackResult) .Where(m => m != null)); var callbackFactory = new CallbackFactory <TMarshal>(callbackExecutor); var binder = new ObjectBinderBuilder <TMarshal>().Use(typeof(CallbackBinder <TMarshal>), callbackFactory) .Use(typeof(OutgoingValueBinder <TMarshal>), bindingRepository) .Use(typeof(PlatformBinder <TMarshal>), parameterBinder).Build(); methodExecutor = new MethodExecutor <TMarshal>(bindingRepository.Objects, binder); propertyExecutor = new PropertyExecutor <TMarshal>(bindingRepository.Objects, binder); disposables.Add(Observable.ObserveOn((callbackExecutor as IObservable <DeleteCallback>), baseScheduler) .Subscribe(OnDeleteCallback)); disposables.Add(Observable.ObserveOn((callbackExecutor as IObservable <CallbackExecution <TMarshal> >), baseScheduler) .Subscribe(OnCallbackExecution)); // ReSharper disable once InvokeAsExtensionMethod disposables.Add(baseMessages .Select(m => m.MethodExecution) .Where(m => m != null) .Subscribe(OnMethodExecution)); disposables.Add(baseMessages .Select(m => m.PropertyGet) .Where(m => m != null) .Subscribe(OnPropertyGetExecution)); disposables.Add(baseMessages .Select(m => m.PropertySet) .Where(m => m != null) .Subscribe(OnPropertySetExecution)); disposables.Add(baseMessages .Select(m => m.DynamicObjectRequest) .Where(m => m != null) .Subscribe(OnDyanmicObjectRequest)); disposables.Add(connection); }
protected TaggedHooksFirstExecutionProcessor(IMethodExecutor methodExecutor) : base(methodExecutor) { Strategy = new TaggedHooksFirstStrategy(); }
public StepExecutionEndingProcessor(IMethodExecutor methodExecutor) : base(methodExecutor) { }
protected TaggedHooksFirstExecutionProcessor(IHookRegistry hookRegistry, IMethodExecutor methodExecutor) : base(hookRegistry, methodExecutor) { Strategy = new TaggedHooksFirstStrategy(); }
public ScenarioExecutionEndingProcessor(IMethodExecutor methodExecutor, ISandbox sandbox) : base(methodExecutor) { _sandbox = sandbox; }
public ExecuteStepProcessor(IStepRegistry stepRegistry, IMethodExecutor methodExecutor, ITableFormatter tableFormatter) { _tableFormatter = tableFormatter; _stepRegistry = stepRegistry; _methodExecutor = methodExecutor; }
public TestUntaggedHooksFirstExecutionProcessor(IMethodExecutor methodExecutor, IAssemblyLoader assemblyLoader, IReflectionWrapper reflectionWrapper) : base(methodExecutor, assemblyLoader, reflectionWrapper) { }
public SpecExecutionStartingProcessor(IMethodExecutor methodExecutor, ISandbox sandbox) : base(methodExecutor) { _sandbox = sandbox; }
public ExecutionStartingProcessor(IMethodExecutor methodExecutor) : base(methodExecutor) { }
protected UntaggedHooksFirstExecutionProcessor(IMethodExecutor methodExecutor, IAssemblyLoader assemblyLoader, IReflectionWrapper reflectionWrapper) : base(methodExecutor, assemblyLoader, reflectionWrapper) { Strategy = new UntaggedHooksFirstStrategy(); }
public ScenarioExecutionEndingProcessor(IHookRegistry hookRegistry, IMethodExecutor methodExecutor, ISandbox sandbox) : base(hookRegistry, methodExecutor) { _sandbox = sandbox; }
protected HookExecutionProcessor(IMethodExecutor methodExecutor) { MethodExecutor = methodExecutor; Strategy = new HooksStrategy(); }
public SpecExecutionStartingProcessor(IMethodExecutor methodExecutor, ISandbox sandbox, IAssemblyLoader assemblyLoader, IReflectionWrapper reflectionWrapper) : base(methodExecutor, assemblyLoader, reflectionWrapper) { _sandbox = sandbox; }
public StepExecutionStartingProcessor(IHookRegistry hookRegistry, IMethodExecutor methodExecutor) : base(hookRegistry, methodExecutor) { }
public static Task <object> ExecuteAsync(this IMethodExecutor executor, object target, params object[] args) => executor.Execute(target, args).CreateResult();
public ExecuteStepProcessor(IStepRegistry stepRegistry, IMethodExecutor methodExecutor) { _stepRegistry = stepRegistry; _methodExecutor = methodExecutor; InitializeConverter(); }
protected HookExecutionProcessor(IHookRegistry hookRegistry, IMethodExecutor methodExecutor) { MethodExecutor = methodExecutor; Hooks = hookRegistry; Strategy = new HooksStrategy(); }
public StepExecutionEndingProcessor(IMethodExecutor methodExecutor, IAssemblyLoader assemblyLoader, IReflectionWrapper reflectionWrapper) : base(methodExecutor, assemblyLoader, reflectionWrapper) { }
public SpecExecutionEndingProcessor(IHookRegistry hookRegistry, IMethodExecutor methodExecutor) : base(hookRegistry, methodExecutor) { }
public SpecExecutionStartingProcessor(IHookRegistry hookRegistry, IMethodExecutor methodExecutor, ISandbox sandbox) : base(hookRegistry, methodExecutor) { _sandbox = sandbox; }
public ExecuteStepProcessor(IStepRegistry stepRegistry, IMethodExecutor methodExecutor) { _stepRegistry = stepRegistry; _methodExecutor = methodExecutor; }