예제 #1
0
 public ErrorResponseProvider(IErrorProvider errorProvider,
                              IErrorMessageFormatter errorMessageFormatter,
                              IHttpStatusCodeProvider responseCodeProvider,
                              IErrorResponseProviderOptions options)
 {
     if (errorProvider == null)
     {
         throw new ArgumentNullException(nameof(errorProvider));
     }
     if (errorMessageFormatter == null)
     {
         throw new ArgumentNullException(nameof(errorMessageFormatter));
     }
     if (responseCodeProvider == null)
     {
         throw new ArgumentNullException(nameof(responseCodeProvider));
     }
     if (options == null)
     {
         throw new ArgumentNullException(nameof(options));
     }
     _errorProvider         = errorProvider;
     _errorMessageFormatter = errorMessageFormatter;
     _responseCodeProvider  = responseCodeProvider;
     _options = options;
 }
예제 #2
0
 public GhprTestExecutionEngine(
     IStepFormatter stepFormatter,
     ITestTracer testTracer,
     IErrorProvider errorProvider,
     IStepArgumentTypeConverter stepArgumentTypeConverter,
     SpecFlowConfiguration specFlowConfiguration,
     IBindingRegistry bindingRegistry,
     IUnitTestRuntimeProvider unitTestRuntimeProvider,
     IStepDefinitionSkeletonProvider stepDefinitionSkeletonProvider,
     IContextManager contextManager,
     IStepDefinitionMatchService stepDefinitionMatchService,
     IDictionary <string, IStepErrorHandler> stepErrorHandlers,
     IBindingInvoker bindingInvoker,
     IObsoleteStepHandler obsoleteStepHandler,
     ITestObjectResolver testObjectResolver,
     IObjectContainer objectContainer)
 {
     _engine = new TestExecutionEngine(stepFormatter,
                                       testTracer,
                                       errorProvider,
                                       stepArgumentTypeConverter,
                                       specFlowConfiguration,
                                       bindingRegistry,
                                       unitTestRuntimeProvider,
                                       stepDefinitionSkeletonProvider,
                                       contextManager,
                                       stepDefinitionMatchService,
                                       stepErrorHandlers,
                                       bindingInvoker,
                                       obsoleteStepHandler,
                                       testObjectResolver,
                                       objectContainer);
 }
예제 #3
0
 public GhprTestExecutionEngine(
     IStepFormatter stepFormatter,
     ITestTracer testTracer,
     IErrorProvider errorProvider,
     IStepArgumentTypeConverter stepArgumentTypeConverter,
     RuntimeConfiguration runtimeConfiguration,
     IBindingRegistry bindingRegistry,
     IUnitTestRuntimeProvider unitTestRuntimeProvider,
     IStepDefinitionSkeletonProvider stepDefinitionSkeletonProvider,
     IContextManager contextManager,
     IStepDefinitionMatchService stepDefinitionMatchService,
     IDictionary <string, IStepErrorHandler> stepErrorHandlers,
     IBindingInvoker bindingInvoker)
 {
     _engine = new TestExecutionEngine(stepFormatter,
                                       testTracer,
                                       errorProvider,
                                       stepArgumentTypeConverter,
                                       runtimeConfiguration,
                                       bindingRegistry,
                                       unitTestRuntimeProvider,
                                       stepDefinitionSkeletonProvider,
                                       contextManager,
                                       stepDefinitionMatchService,
                                       stepErrorHandlers,
                                       bindingInvoker);
     _reporter = new Reporter(TestingFramework.SpecFlow);
 }
예제 #4
0
 public TestExecutionEngine(IStepFormatter stepFormatter, ITestTracer testTracer, IErrorProvider errorProvider, IStepArgumentTypeConverter stepArgumentTypeConverter,
                            SpecFlowConfiguration specFlowConfiguration, IBindingRegistry bindingRegistry, IUnitTestRuntimeProvider unitTestRuntimeProvider, IContextManager contextManager, IStepDefinitionMatchService stepDefinitionMatchService,
                            IDictionary <string, IStepErrorHandler> stepErrorHandlers, IBindingInvoker bindingInvoker, IObsoleteStepHandler obsoleteStepHandler, ICucumberMessageSender cucumberMessageSender, ITestResultFactory testResultFactory,
                            ITestPendingMessageFactory testPendingMessageFactory, ITestUndefinedMessageFactory testUndefinedMessageFactory,
                            ITestObjectResolver testObjectResolver = null, IObjectContainer testThreadContainer = null) //TODO: find a better way to access the container
 {
     _errorProvider           = errorProvider;
     _bindingInvoker          = bindingInvoker;
     _contextManager          = contextManager;
     _unitTestRuntimeProvider = unitTestRuntimeProvider;
     _bindingRegistry         = bindingRegistry;
     _specFlowConfiguration   = specFlowConfiguration;
     _testTracer                  = testTracer;
     _stepFormatter               = stepFormatter;
     _stepArgumentTypeConverter   = stepArgumentTypeConverter;
     _stepErrorHandlers           = stepErrorHandlers?.Values.ToArray();
     _stepDefinitionMatchService  = stepDefinitionMatchService;
     _testObjectResolver          = testObjectResolver;
     TestThreadContainer          = testThreadContainer;
     _obsoleteStepHandler         = obsoleteStepHandler;
     _cucumberMessageSender       = cucumberMessageSender;
     _testResultFactory           = testResultFactory;
     _testPendingMessageFactory   = testPendingMessageFactory;
     _testUndefinedMessageFactory = testUndefinedMessageFactory;
 }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TestProjectBindingInvoker"/> class.
 /// </summary>
 /// <param name="specFlowConfiguration">The active SpecFlow configuration.</param>
 /// <param name="errorProvider">A reference to an error provider.</param>
 /// <param name="synchronousBindingDelegateInvoker">Delegate invoker.</param>
 public TestProjectBindingInvoker(
     SpecFlowConfiguration specFlowConfiguration,
     IErrorProvider errorProvider,
     ISynchronousBindingDelegateInvoker synchronousBindingDelegateInvoker)
     : base(specFlowConfiguration, errorProvider, synchronousBindingDelegateInvoker)
 {
 }
        public TosterParseService(ITosterParse tosterParse, IQuestionRepository repository, IErrorProvider errorProvider, IPushAllProvider pushAllProvider)
        {
            if (tosterParse == null)
            {
                throw new ArgumentNullException("tosterParse");
            }
            _tosterParse = tosterParse;

            if (repository == null)
            {
                throw new ArgumentNullException("repository");
            }
            _repository = repository;

            if (errorProvider == null)
            {
                throw new ArgumentNullException("errorProvider");
            }
            _errorProvider = errorProvider;

            if (pushAllProvider == null)
            {
                throw new ArgumentNullException("pushAllProvider");
            }
            _pushAllProvider = pushAllProvider;
        }
예제 #7
0
 public BindingInvoker(RuntimeConfiguration runtimeConfiguration,
                       IErrorProvider errorProvider,
                       IHookRegistry hookRegistry)
 {
     _hookRegistry  = hookRegistry;
     _targetInvoker = new TechTalk.SpecFlow.Bindings.BindingInvoker(runtimeConfiguration, errorProvider);
 }
예제 #8
0
        public StackoverflowParseService(IStackoverflowParse stackoverflowParse, IQuestionRepository repository, IErrorProvider errorProvider, IPushAllProvider pushAllProvider)
        {
            if (stackoverflowParse == null)
            {
                throw new ArgumentNullException("stackoverflowParse");
            }
            _stackoverflowParse = stackoverflowParse;

            if (repository == null)
            {
                throw new ArgumentNullException("repository");
            }
            _repository = repository;

            if (errorProvider == null)
            {
                throw new ArgumentNullException("errorProvider");
            }
            _errorProvider = errorProvider;

            if (pushAllProvider == null)
            {
                throw new ArgumentNullException("pushAllProvider");
            }
            _pushAllProvider = pushAllProvider;
        }
예제 #9
0
 private static void DisplayStatus(string szAPI, IErrorProvider Status)
 {
     //
     // Convert the NTStatus to Winerror. Then call DisplayWinError().
     //
     Console.Error.WriteLine(szAPI + " error!");
     Console.Error.WriteLine(Status.ToString());
 }
예제 #10
0
 public MetricClient(IPEndPoint endPoint, TimeSpan interval, IErrorProvider errorProvider)
 {
     _endPoint       = endPoint ?? throw new ArgumentNullException(nameof(endPoint));
     _errorProvider  = errorProvider ?? throw new ArgumentNullException(nameof(errorProvider));
     _waitHandle     = new AutoResetEvent(false);
     _timer          = new RegularTimer(interval.TotalMilliseconds);
     _timer.Elapsed += (sender, e) => _waitHandle.Set();
 }
예제 #11
0
 public Session(TcpClient client, IErrorProvider errorProvider, TimeSpan interval)
 {
     _interval      = interval + interval;
     _errorProvider = errorProvider ?? throw new ArgumentNullException(nameof(errorProvider));
     _client        = client ?? throw new ArgumentNullException(nameof(client));
     _stream        = client.GetStream();
     _bytes         = new byte[sizeof(int)];
 }
 public StateMachine(Func <States, IState> stateProvider, IConnector connector, BarcodeScanner scanner, IErrorProvider errorProvider)
 {
     _stateProvider            = stateProvider;
     _connector                = connector;
     _scanner                  = scanner;
     _errorProvider            = errorProvider;
     _scanner.BarcodeReceived += HandleInput;
     SwitchToState(States.Welcome);
 }
예제 #13
0
        /// <summary>
        ///    Throws an exception for the response if none of the statuses match.
        /// </summary>
        /// <param name="errorProvider">The error provider.</param>
        /// <param name="response">The response.</param>
        /// <param name="validStatuses">The valid statuses.</param>
        public static void ThrowIfStatusMismatch(this IErrorProvider errorProvider, IRestResponse response, params HttpStatusCode[] validStatuses)
        {
            bool mismatch = validStatuses.All(status => response.StatusCode != status);

            if (mismatch)
            {
                errorProvider.ThrowFromResponse(response);
            }
        }
예제 #14
0
        public StepDefinitionBinding(RuntimeConfiguration runtimeConfiguration, IErrorProvider errorProvider, BindingType type, string regexString, MethodInfo methodInfo, BindingScope bindingScope)
            : base(runtimeConfiguration, errorProvider, methodInfo)
        {
            Type = type;
            Regex regex = new Regex("^" + regexString + "$", RegexOptions);

            Regex             = regex;
            this.BindingScope = bindingScope;
        }
예제 #15
0
        protected MethodBinding(RuntimeConfiguration runtimeConfiguration, IErrorProvider errorProvider, MethodInfo method)
        {
            this.runtimeConfiguration = runtimeConfiguration;
            this.errorProvider = errorProvider;

            BindingAction = CreateMethodDelegate(method);
            MethodInfo = method;
            ParameterTypes = method.GetParameters().Select(pi => pi.ParameterType).ToArray();
            ReturnType = method.ReturnType;
        }
예제 #16
0
        protected MethodBinding(RuntimeConfiguration runtimeConfiguration, IErrorProvider errorProvider, MethodInfo method)
        {
            this.runtimeConfiguration = runtimeConfiguration;
            this.errorProvider        = errorProvider;

            BindingAction  = CreateMethodDelegate(method);
            MethodInfo     = method;
            ParameterTypes = method.GetParameters().Select(pi => pi.ParameterType).ToArray();
            ReturnType     = method.ReturnType;
        }
 public ComponentFactory(
     IFormConfiguration configuration,
     IComponentNameResolver nameResolver,
     IComponentIdResolver idResolver,
     IComponentLabelResolver labelResolver,
     IErrorProvider errorProvider)
 {
     this.ErrorProvider = errorProvider;
     this.configuration = configuration;
     this.NameResolver  = nameResolver;
     this.IdResolver    = idResolver;
     this.LabelResolver = labelResolver;
 }
예제 #18
0
 /// <summary>
 ///   Initializes a new instance of the <see cref="Stargate" /> class.
 /// </summary>
 /// <param name="options">The options.</param>
 /// <param name="resourceBuilderFactory">The resource builder factory.</param>
 /// <param name="restSharp">The RestSharp factory.</param>
 /// <param name="converterFactory">The converter factory.</param>
 /// <param name="errorProvider">The error provider.</param>
 /// <param name="scannerConverter">The scanner converter.</param>
 public Stargate(IStargateOptions options, Func <IStargateOptions, IResourceBuilder> resourceBuilderFactory, IRestSharpFactory restSharp,
                 IMimeConverterFactory converterFactory, IErrorProvider errorProvider, IScannerOptionsConverter scannerConverter)
 {
     ResourceBuilder     = resourceBuilderFactory(options);
     RestSharp           = restSharp;
     ErrorProvider       = errorProvider;
     ScannerConverter    = scannerConverter;
     Client              = RestSharp.CreateClient(options.ServerUrl);
     options.ContentType = string.IsNullOrEmpty(options.ContentType) ? DefaultContentType : options.ContentType;
     Converter           = converterFactory.CreateConverter(options.ContentType);
     options.FalseRowKey = string.IsNullOrEmpty(options.FalseRowKey) ? DefaultFalseRowKey : options.FalseRowKey;
     Options             = options;
 }
예제 #19
0
		/// <summary>
		///    Initializes a new instance of the <see cref="Stargate" /> class.
		/// </summary>
		/// <param name="options">The options.</param>
		/// <param name="resourceBuilder">The resource builder.</param>
		/// <param name="restSharp">The RestSharp factory.</param>
		/// <param name="converterFactory">The converter factory.</param>
		/// <param name="errorProvider">The error provider.</param>
		/// <param name="scannerConverter">The scanner converter.</param>
		public Stargate(IStargateOptions options, IResourceBuilder resourceBuilder, IRestSharpFactory restSharp, IMimeConverterFactory converterFactory,
			IErrorProvider errorProvider, IScannerOptionsConverter scannerConverter)
		{
			_resourceBuilder = resourceBuilder;
			_restSharp = restSharp;
			_errorProvider = errorProvider;
			_scannerConverter = scannerConverter;
			_client = _restSharp.CreateClient(options.ServerUrl);
			options.ContentType = string.IsNullOrEmpty(options.ContentType) ? DefaultContentType : options.ContentType;
			_converter = converterFactory.CreateConverter(options.ContentType);
			options.FalseRowKey = string.IsNullOrEmpty(options.FalseRowKey) ? DefaultFalseRowKey : options.FalseRowKey;
			Options = options;
		}
예제 #20
0
 public BitmapCaptchaFactory(CaptchaOptions options, Func <ICache> challengeCacheFactory)
     : base(options, challengeCacheFactory)
 {
     m_contentProvider = new BitmapContent(options,
                                           new JpegImageCodecInfo(options),
                                           new IGraphicsDrawing[]
     {
         new BackgroundDrawing(options),
         new WarpTextDrawing(options),
         new EllipseDrawing(options),
         new CurveDrawing(options)
     });
     m_errorProvider = new EmptyErrorProvider();
 }
예제 #21
0
        public PushAllProvider(IQuestionRepository repository, IErrorProvider errorProvider)
        {
            if (repository == null)
            {
                throw new ArgumentNullException("repository");
            }
            _repository = repository;

            if (errorProvider == null)
            {
                throw new ArgumentNullException("errorProvider");
            }
            _errorProvider = errorProvider;
        }
예제 #22
0
 public TestExecutionEngine(
     IStepFormatter stepFormatter,
     ITestTracer testTracer,
     IErrorProvider errorProvider,
     IStepArgumentTypeConverter stepArgumentTypeConverter,
     SpecFlowConfiguration specFlowConfiguration,
     IBindingRegistry bindingRegistry,
     IUnitTestRuntimeProvider unitTestRuntimeProvider,
     IContextManager contextManager,
     IStepDefinitionMatchService stepDefinitionMatchService,
     IBindingInvoker bindingInvoker,
     IObsoleteStepHandler obsoleteStepHandler,
     ICucumberMessageSender cucumberMessageSender,
     ITestResultFactory testResultFactory,
     ITestPendingMessageFactory testPendingMessageFactory,
     ITestUndefinedMessageFactory testUndefinedMessageFactory,
     ITestRunResultCollector testRunResultCollector,
     IAnalyticsEventProvider analyticsEventProvider,
     IAnalyticsTransmitter analyticsTransmitter,
     ITestRunnerManager testRunnerManager,
     IRuntimePluginTestExecutionLifecycleEventEmitter runtimePluginTestExecutionLifecycleEventEmitter,
     ITestThreadExecutionEventPublisher testThreadExecutionEventPublisher,
     ITestObjectResolver testObjectResolver = null,
     IObjectContainer testThreadContainer   = null) //TODO: find a better way to access the container
 {
     _errorProvider           = errorProvider;
     _bindingInvoker          = bindingInvoker;
     _contextManager          = contextManager;
     _unitTestRuntimeProvider = unitTestRuntimeProvider;
     _bindingRegistry         = bindingRegistry;
     _specFlowConfiguration   = specFlowConfiguration;
     _testTracer                  = testTracer;
     _stepFormatter               = stepFormatter;
     _stepArgumentTypeConverter   = stepArgumentTypeConverter;
     _stepDefinitionMatchService  = stepDefinitionMatchService;
     _testObjectResolver          = testObjectResolver;
     TestThreadContainer          = testThreadContainer;
     _obsoleteStepHandler         = obsoleteStepHandler;
     _cucumberMessageSender       = cucumberMessageSender;
     _testResultFactory           = testResultFactory;
     _testPendingMessageFactory   = testPendingMessageFactory;
     _testUndefinedMessageFactory = testUndefinedMessageFactory;
     _testRunResultCollector      = testRunResultCollector;
     _analyticsEventProvider      = analyticsEventProvider;
     _analyticsTransmitter        = analyticsTransmitter;
     _testRunnerManager           = testRunnerManager;
     _runtimePluginTestExecutionLifecycleEventEmitter = runtimePluginTestExecutionLifecycleEventEmitter;
     _testThreadExecutionEventPublisher = testThreadExecutionEventPublisher;
 }
예제 #23
0
        public TestExecutionEngine(IStepFormatter stepFormatter, ITestTracer testTracer, IErrorProvider errorProvider, IStepArgumentTypeConverter stepArgumentTypeConverter, 
            RuntimeConfiguration runtimeConfiguration, IBindingRegistry bindingRegistry, IUnitTestRuntimeProvider unitTestRuntimeProvider, 
            IDictionary<ProgrammingLanguage, IStepDefinitionSkeletonProvider> stepDefinitionSkeletonProviders, IContextManager contextManager)
        {
            this.errorProvider = errorProvider;
            this.contextManager = contextManager;
            this.stepDefinitionSkeletonProviders = stepDefinitionSkeletonProviders;
            this.unitTestRuntimeProvider = unitTestRuntimeProvider;
            this.bindingRegistry = bindingRegistry;
            this.runtimeConfiguration = runtimeConfiguration;
            this.testTracer = testTracer;
            this.stepFormatter = stepFormatter;
            this.stepArgumentTypeConverter = stepArgumentTypeConverter;

            this.currentStepDefinitionSkeletonProvider = stepDefinitionSkeletonProviders[ProgrammingLanguage.CSharp]; // fallback if feature initialization was not proper
        }
예제 #24
0
 public GhprTestExecutionEngine(
     IStepFormatter stepFormatter,
     ITestTracer testTracer,
     IErrorProvider errorProvider,
     IStepArgumentTypeConverter stepArgumentTypeConverter,
     SpecFlowConfiguration specFlowConfiguration,
     IBindingRegistry bindingRegistry,
     IUnitTestRuntimeProvider unitTestRuntimeProvider,
     IContextManager contextManager,
     IStepDefinitionMatchService stepDefinitionMatchService,
     IDictionary <string, IStepErrorHandler> stepErrorHandlers,
     IBindingInvoker bindingInvoker,
     IObsoleteStepHandler obsoleteStepHandler,
     ICucumberMessageSender cucumberMessageSender,
     ITestResultFactory testResultFactory,
     ITestPendingMessageFactory testPendingMessageFactory,
     ITestUndefinedMessageFactory testUndefinedMessageFactory,
     ITestRunResultCollector testRunResultCollector,
     IAnalyticsEventProvider analyticsEventProvider,
     IAnalyticsTransmitter analyticsTransmitter,
     ITestRunnerManager testRunnerManager,
     ITestObjectResolver testObjectResolver = null,
     IObjectContainer testThreadContainer   = null)
 {
     _engine = new TestExecutionEngine(stepFormatter,
                                       testTracer,
                                       errorProvider,
                                       stepArgumentTypeConverter,
                                       specFlowConfiguration,
                                       bindingRegistry,
                                       unitTestRuntimeProvider,
                                       contextManager,
                                       stepDefinitionMatchService,
                                       stepErrorHandlers,
                                       bindingInvoker,
                                       obsoleteStepHandler,
                                       cucumberMessageSender,
                                       testResultFactory,
                                       testPendingMessageFactory,
                                       testUndefinedMessageFactory,
                                       testRunResultCollector,
                                       analyticsEventProvider,
                                       analyticsTransmitter,
                                       testRunnerManager,
                                       testObjectResolver,
                                       testThreadContainer);
 }
예제 #25
0
 public TestExecutionEngine(IStepFormatter stepFormatter, ITestTracer testTracer, IErrorProvider errorProvider, IStepArgumentTypeConverter stepArgumentTypeConverter,
                            RuntimeConfiguration runtimeConfiguration, IBindingRegistry bindingRegistry, IUnitTestRuntimeProvider unitTestRuntimeProvider,
                            IStepDefinitionSkeletonProvider stepDefinitionSkeletonProvider, IContextManager contextManager, IStepDefinitionMatchService stepDefinitionMatchService,
                            IDictionary <string, IStepErrorHandler> stepErrorHandlers, IBindingInvoker bindingInvoker)
 {
     this.errorProvider                  = errorProvider;
     this.bindingInvoker                 = bindingInvoker;
     this.contextManager                 = contextManager;
     this.unitTestRuntimeProvider        = unitTestRuntimeProvider;
     this.stepDefinitionSkeletonProvider = stepDefinitionSkeletonProvider;
     this.bindingRegistry                = bindingRegistry;
     this.runtimeConfiguration           = runtimeConfiguration;
     this.testTracer                 = testTracer;
     this.stepFormatter              = stepFormatter;
     this.stepArgumentTypeConverter  = stepArgumentTypeConverter;
     this.stepErrorHandlers          = stepErrorHandlers == null ? null : stepErrorHandlers.Values.ToArray();
     this.stepDefinitionMatchService = stepDefinitionMatchService;
 }
예제 #26
0
 public TestExecutionEngine(IStepFormatter stepFormatter, ITestTracer testTracer, IErrorProvider errorProvider, IStepArgumentTypeConverter stepArgumentTypeConverter, 
     RuntimeConfiguration runtimeConfiguration, IBindingRegistry bindingRegistry, IUnitTestRuntimeProvider unitTestRuntimeProvider, 
     IStepDefinitionSkeletonProvider stepDefinitionSkeletonProvider, IContextManager contextManager, IStepDefinitionMatchService stepDefinitionMatchService,
     IDictionary<string, IStepErrorHandler> stepErrorHandlers, IBindingInvoker bindingInvoker)
 {
     this.errorProvider = errorProvider;
     this.bindingInvoker = bindingInvoker;
     this.contextManager = contextManager;
     this.unitTestRuntimeProvider = unitTestRuntimeProvider;
     this.stepDefinitionSkeletonProvider = stepDefinitionSkeletonProvider;
     this.bindingRegistry = bindingRegistry;
     this.runtimeConfiguration = runtimeConfiguration;
     this.testTracer = testTracer;
     this.stepFormatter = stepFormatter;
     this.stepArgumentTypeConverter = stepArgumentTypeConverter;
     this.stepErrorHandlers = stepErrorHandlers == null ? null : stepErrorHandlers.Values.ToArray();
     this.stepDefinitionMatchService = stepDefinitionMatchService;
 }
예제 #27
0
        public TestExecutionEngine(IStepFormatter stepFormatter, ITestTracer testTracer, IErrorProvider errorProvider, IStepArgumentTypeConverter stepArgumentTypeConverter,
                                   RuntimeConfiguration runtimeConfiguration, IBindingRegistry bindingRegistry, IUnitTestRuntimeProvider unitTestRuntimeProvider,
                                   IDictionary <ProgrammingLanguage, IStepDefinitionSkeletonProvider> stepDefinitionSkeletonProviders, IContextManager contextManager, IStepDefinitionMatcher stepDefinitionMatcher,
                                   IDictionary <string, IStepErrorHandler> stepErrorHandlers)
        {
            this.errorProvider                   = errorProvider;
            this.stepDefinitionMatcher           = stepDefinitionMatcher;
            this.contextManager                  = contextManager;
            this.stepDefinitionSkeletonProviders = stepDefinitionSkeletonProviders;
            this.unitTestRuntimeProvider         = unitTestRuntimeProvider;
            this.bindingRegistry                 = bindingRegistry;
            this.runtimeConfiguration            = runtimeConfiguration;
            this.testTracer                = testTracer;
            this.stepFormatter             = stepFormatter;
            this.stepArgumentTypeConverter = stepArgumentTypeConverter;
            this.stepErrorHandlers         = stepErrorHandlers == null ? null : stepErrorHandlers.Values.ToArray();

            this.currentStepDefinitionSkeletonProvider = stepDefinitionSkeletonProviders[ProgrammingLanguage.CSharp]; // fallback if feature initialization was not proper
        }
 public TestExecutionEngine(IStepFormatter stepFormatter, ITestTracer testTracer, IErrorProvider errorProvider, IStepArgumentTypeConverter stepArgumentTypeConverter,
                            Configuration.SpecFlowConfiguration specFlowConfiguration, IBindingRegistry bindingRegistry, IUnitTestRuntimeProvider unitTestRuntimeProvider,
                            IStepDefinitionSkeletonProvider stepDefinitionSkeletonProvider, IContextManager contextManager, IStepDefinitionMatchService stepDefinitionMatchService,
                            IDictionary <string, IStepErrorHandler> stepErrorHandlers, IBindingInvoker bindingInvoker, ITestObjectResolver testObjectResolver = null, IObjectContainer testThreadContainer = null) //TODO: find a better way to access the container
 {
     this.errorProvider                  = errorProvider;
     this.bindingInvoker                 = bindingInvoker;
     this.contextManager                 = contextManager;
     this.unitTestRuntimeProvider        = unitTestRuntimeProvider;
     this.stepDefinitionSkeletonProvider = stepDefinitionSkeletonProvider;
     this.bindingRegistry                = bindingRegistry;
     this.specFlowConfiguration          = specFlowConfiguration;
     this.testTracer                 = testTracer;
     this.stepFormatter              = stepFormatter;
     this.stepArgumentTypeConverter  = stepArgumentTypeConverter;
     this.stepErrorHandlers          = stepErrorHandlers == null ? null : stepErrorHandlers.Values.ToArray();
     this.stepDefinitionMatchService = stepDefinitionMatchService;
     this.testObjectResolver         = testObjectResolver;
     this.TestThreadContainer        = testThreadContainer;
 }
예제 #29
0
        public void TestClearErrorProviders()
        {
            //---------------Set up test pack-------------------
            IClassDef    classDef       = Sample.CreateClassDefWithTwoPropsOneCompulsory();
            PanelBuilder panelBuilder   = new PanelBuilder(GetControlFactory());
            IPanelInfo   panelInfo      = panelBuilder.BuildPanelForTab((UIFormTab)classDef.UIDefCol["default"].UIForm[0]);
            Sample       businessObject = new Sample();

            panelInfo.BusinessObject = businessObject;

            //businessObject.SetPropertyValue("SampleText2", "sdlkfj");
            PanelInfo.FieldInfo fieldInfo = panelInfo.FieldInfos["SampleText2"];
            panelInfo.ApplyChangesToBusinessObject();
            IErrorProvider errorProvider = fieldInfo.ControlMapper.ErrorProvider;

            //---------------Assert Precondition----------------
            Assert.IsTrue(errorProvider.GetError(fieldInfo.InputControl).Length > 0);
            //---------------Execute Test ----------------------
            panelInfo.ClearErrorProviders();
            //---------------Test Result -----------------------
            Assert.IsFalse(errorProvider.GetError(fieldInfo.InputControl).Length > 0);
        }
예제 #30
0
        public TestExecutionEngine(IStepFormatter stepFormatter, ITestTracer testTracer, IErrorProvider errorProvider, IStepArgumentTypeConverter stepArgumentTypeConverter, 
            RuntimeConfiguration runtimeConfiguration, IBindingRegistry bindingRegistry, IUnitTestRuntimeProvider unitTestRuntimeProvider, 
            IDictionary<ProgrammingLanguage, IStepDefinitionSkeletonProvider> stepDefinitionSkeletonProviders, IContextManager contextManager, IStepDefinitionMatchService stepDefinitionMatchService,
            IDictionary<string, IStepErrorHandler> stepErrorHandlers, IBindingInvoker bindingInvoker, IRuntimeBindingRegistryBuilder bindingRegistryBuilder)
        {
            this.errorProvider = errorProvider;
            //this.stepDefinitionMatcher = stepDefinitionMatcher;
            this.bindingInvoker = bindingInvoker;
            this.bindingRegistryBuilder = bindingRegistryBuilder;
            this.contextManager = contextManager;
            this.stepDefinitionSkeletonProviders = stepDefinitionSkeletonProviders;
            this.unitTestRuntimeProvider = unitTestRuntimeProvider;
            this.bindingRegistry = bindingRegistry;
            this.runtimeConfiguration = runtimeConfiguration;
            this.testTracer = testTracer;
            this.stepFormatter = stepFormatter;
            this.stepArgumentTypeConverter = stepArgumentTypeConverter;
            this.stepErrorHandlers = stepErrorHandlers == null ? null : stepErrorHandlers.Values.ToArray();

            this.currentStepDefinitionSkeletonProvider = stepDefinitionSkeletonProviders[ProgrammingLanguage.CSharp]; // fallback if feature initialization was not proper

            this.stepDefinitionMatchService = stepDefinitionMatchService;
        }
 public ActivationGuard(TimeSpan inactivityTimeout, IErrorProvider errorProvider)
 {
     _errorProvider            = errorProvider;
     _inactivityTimer          = new Timer(inactivityTimeout.TotalMilliseconds);
     _inactivityTimer.Elapsed += InactivityTimerOnElapsed;
 }
 public AllureBindingInvoker(SpecFlowConfiguration specFlowConfiguration, IErrorProvider errorProvider) : base(
         specFlowConfiguration, errorProvider)
 {
 }
	    ///<summary>
	    /// Constructor for <see cref="ValidationProvider"/>
	    ///</summary>
	    ///<param name="errorProvider"></param>
	    public ValidationProvider(IErrorProvider errorProvider)
	    {
            _errorProvider = errorProvider;
	    }
예제 #34
0
 public BindingInvoker(RuntimeConfiguration runtimeConfiguration, IErrorProvider errorProvider)
 {
     this.runtimeConfiguration = runtimeConfiguration;
     this.errorProvider = errorProvider;
 }
예제 #35
0
 public EventBinding(RuntimeConfiguration runtimeConfiguration, IErrorProvider errorProvider, MethodInfo methodInfo, BindingScope bindingScope)
     : base(runtimeConfiguration, errorProvider, methodInfo)
 {
     BindingScope = bindingScope;
 }
예제 #36
0
 public BindingFactory(IObjectContainer container)
 {
     this.runtimeConfiguration = container.Resolve <RuntimeConfiguration>();
     this.errorProvider        = container.Resolve <IErrorProvider>();
 }
예제 #37
0
 internal BindingFactory(RuntimeConfiguration runtimeConfiguration, IErrorProvider errorProvider)
 {
     this.runtimeConfiguration = runtimeConfiguration;
     this.errorProvider        = errorProvider;
 }
예제 #38
0
 public BindingFactory(IObjectContainer container)
 {
     this.runtimeConfiguration = container.Resolve<RuntimeConfiguration>();
     this.errorProvider = container.Resolve<IErrorProvider>();
 }
예제 #39
0
 internal BindingFactory(RuntimeConfiguration runtimeConfiguration, IErrorProvider errorProvider)
 {
     this.runtimeConfiguration = runtimeConfiguration;
     this.errorProvider = errorProvider;
 }
예제 #40
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JsonParser"/> class.
 /// </summary>
 /// <param name="errorProvider">
 /// The error provider.
 /// </param>
 public JsonParser(IErrorProvider errorProvider)
 {
     this.errorProvider = errorProvider;
 }
 public RuntimeBindingSourceProcessor(IBindingFactory bindingFactory, IBindingRegistry bindingRegistry, IErrorProvider errorProvider, ITestTracer testTracer) : base(bindingFactory)
 {
     this.bindingRegistry = bindingRegistry;
     this.errorProvider = errorProvider;
     this.testTracer = testTracer;
 }
예제 #42
0
 public BindingRegistry(IErrorProvider errorProvider, IBindingFactory bindingFactory)
 {
     this.errorProvider = errorProvider;
     this.bindingFactory = bindingFactory;
 }