コード例 #1
0
ファイル: BindingMap.cs プロジェクト: richieallen/SpecFlow
        public void SaveToFile(string fileName, IIdeTracer tracer)
        {
            try
            {
                string folder = Path.GetDirectoryName(fileName);
                Debug.Assert(folder != null);

                if (!Directory.Exists(folder))
                {
                    Directory.CreateDirectory(folder);
                }

                var serializer = new StepMapSetializer();

                string tempFileName = fileName + ".new";

                using (var writer = new StreamWriter(tempFileName, false, Encoding.UTF8))
                {
                    serializer.Serialize(writer, this);
                }

                File.Copy(tempFileName, fileName, true);
                File.Delete(tempFileName);

                tracer.Trace(string.Format("StepMap with {0} feature files and {1} step definitions saved", FeatureFileCount, StepDefinitionCount), GetType().Name);
            }
            catch (Exception saveException)
            {
                tracer.Trace(string.Format("StepMap saving error: {0}", saveException), typeof(StepMap).Name);
            }
        }
コード例 #2
0
        public FileChangeEventsListener(IIdeTracer tracer)
        {
            this.tracer = tracer;
            InitNullEvents();

            fileChangeEx = Package.GetGlobalService(typeof(SVsFileChangeEx)) as IVsFileChangeEx;
        }
コード例 #3
0
 public SpecRunTestRunnerGateway(IOutputWindowService outputWindowService, IIdeTracer tracer, IProjectScopeFactory projectScopeFactory, DTE2 dte)
 {
     this.outputWindowService = outputWindowService;
     this.dte = dte;
     this.projectScopeFactory = projectScopeFactory;
     this.tracer = tracer;
 }
コード例 #4
0
 public InstallServices(IGuidanceNotificationService notificationService, IIdeTracer tracer, IFileAssociationDetector fileAssociationDetector, IStatusAccessor statusAccessor)
 {
     this.notificationService = notificationService;
     this.tracer = tracer;
     this.fileAssociationDetector = fileAssociationDetector;
     this.statusAccessor = statusAccessor;
     IdeIntegration = IdeIntegration.Unknown;
 }
コード例 #5
0
        protected VsProjectFileTrackerBase(Project project, DteWithEvents dteWithEvents, IIdeTracer tracer)
        {
            this.project = project;
            this.dteWithEvents = dteWithEvents;
            this.tracer = tracer;

            this.timer = new Timer(HandleFilesChangedOnDisk, null, Timeout.Infinite, Timeout.Infinite);
        }
コード例 #6
0
        public RemoteAppDomainTestGeneratorFactory(IIdeTracer tracer)
        {
            this.tracer = tracer;
            this.remoteGeneratorAssemblyName = typeof(ITestGeneratorFactory).Assembly.GetName().Name;

            this.AppDomainCleanupTime = TimeSpan.FromSeconds(APPDOMAIN_CLEANUP_SECONDS);
            this.cleanupTimer = new Timer(CleanupTimerElapsed, null, Timeout.Infinite, Timeout.Infinite);
        }
コード例 #7
0
 public VsProjectReferencesTracker(Project project, DteWithEvents dteWithEvents, IIdeTracer tracer)
 {
     this.project = project.Object as VSProject;
     this.dteWithEvents = dteWithEvents;
     this.tracer = tracer;
     this.timer = new Timer(HandleFilesChangedOnDisk, null, Timeout.Infinite, Timeout.Infinite);
     this.triggerReferenceChangedTimer = new Timer(TriggerReferenceChange, null, Timeout.Infinite, Timeout.Infinite);
 }
コード例 #8
0
ファイル: VsGeneratorServices.cs プロジェクト: Galad/SpecFlow
 public VsGeneratorServices(Project project, ISpecFlowConfigurationReader configurationReader, IIdeTracer tracer) : base( //TODO: load dependencies through DI
     new TestGeneratorFactory(), 
     new RemoteAppDomainTestGeneratorFactory(tracer), 
     new VsGeneratorInfoProvider(project, tracer, configurationReader), 
     tracer, false)
 {
     this.project = project;
     this.configurationReader = configurationReader;
 }
コード例 #9
0
 public EditorCommandFilter(IIdeTracer tracer, GoToStepDefinitionCommand goToStepDefinitionCommand, DebugScenariosCommand debugScenariosCommand, RunScenariosCommand runScenariosCommand, FormatTableCommand formatTableCommand, CommentUncommentCommand commentUncommentCommand)
 {
     this.goToStepDefinitionCommand = goToStepDefinitionCommand;
     this.debugScenariosCommand = debugScenariosCommand;
     this.runScenariosCommand = runScenariosCommand;
     this.formatTableCommand = formatTableCommand;
     this.commentUncommentCommand = commentUncommentCommand;
     this.tracer = tracer;
 }
コード例 #10
0
        public GherkinLanguageService(IProjectScope projectScope, IVisualStudioTracer tracer, bool enableStepMatchColoring)
        {
            this.projectScope = projectScope;
            this.tracer = tracer;
            this.enableStepMatchColoring = enableStepMatchColoring && projectScope.StepSuggestionProvider != null;
            AnalyzingEnabled = projectScope.GherkinScopeAnalyzer != null;

            tracer.Trace("Language service created", "GherkinLanguageService");
        }
コード例 #11
0
        public GherkinProcessingScheduler(IIdeTracer tracer, bool enableAnalysis)
        {
            this.tracer = tracer;

            parserQueue = new IdleTaskProcessingQueue(parsingDelay, true, tracer, DoTask);
            parserQueue.Start();

            if (enableAnalysis)
            {
                analyzerQueue = new IdleTaskProcessingQueue(analyzingDelay, false, tracer, DoTask);
                analyzerQueue.Start();
            }
        }
コード例 #12
0
        public DteWithEvents(DTE dte, IIdeTracer tracer)
        {
            DTE = dte;
            SolutionEvents = dte.Events.SolutionEvents;
            ProjectItemsEvents = ((Events2)dte.Events).ProjectItemsEvents;
            DocumentEvents = ((Events2) dte.Events).DocumentEvents;
            BuildEvents = ((Events2) dte.Events).BuildEvents;
            CodeModelEvents = ((Events2)dte.Events).CodeModelEvents;

            SolutionEventsListener = new SolutionEventsListener();
            FileChangeEventsListener = new FileChangeEventsListener(tracer);

            SolutionEvents.BeforeClosing += FileChangeEventsListener.StopListening;
        }
コード例 #13
0
 public VsGeneratorInfoProvider(Project project, IIdeTracer tracer, ISpecFlowConfigurationReader configurationReader)
 {
     this.project             = project;
     this.tracer              = tracer;
     this.configurationReader = configurationReader;
 }
コード例 #14
0
ファイル: MsTestRunnerGateway.cs プロジェクト: Galad/SpecFlow
 public MsTestRunnerGateway(DTE dte, IIdeTracer tracer) : base(dte, tracer)
 {
 }
コード例 #15
0
        public VsGeneratorServices(Project project, ISpecFlowConfigurationReader configurationReader, IIdeTracer tracer,
                                   IIntegrationOptionsProvider integrationOptionsProvider) : base( //TODO: load dependencies through DI
                new TestGeneratorFactory(),
                new RemoteAppDomainTestGeneratorFactory(tracer),
                new OutOfProcessTestGeneratorFactory(tracer, integrationOptionsProvider.GetOptions()),
                new VsGeneratorInfoProvider(project, tracer, configurationReader),
                tracer, false)
        {
            this.project                = project;
            this.configurationReader    = configurationReader;
            _integrationOptionsProvider = integrationOptionsProvider;

            UseOutOfProcess = _integrationOptionsProvider.GetOptions().GenerationMode == GenerationMode.OutOfProcess;
        }
コード例 #16
0
 public ExternalBrowserGuidanceNotificationService(IIdeTracer tracer)
 {
     this.tracer = tracer;
 }
コード例 #17
0
 public TestRunnerGatewayProvider(IObjectContainer container, IIntegrationOptionsProvider integrationOptionsProvider, IIdeTracer tracer)
 {
     this.container = container;
     this.tracer = tracer;
     this.integrationOptionsProvider = integrationOptionsProvider;
 }
コード例 #18
0
 public Vs2008SpecFlowConfigurationReader(Project project, IIdeTracer tracer) : base(tracer)
 {
     this.project = project;
 }
コード例 #19
0
 public GherkinStepCompletionSource(ITextBuffer textBuffer, GherkinLanguageService languageService, IIdeTracer tracer)
 {
     this.textBuffer      = textBuffer;
     this.languageService = languageService;
     this.tracer          = tracer;
 }
コード例 #20
0
 protected GeneratorServices(ITestGeneratorFactory testGeneratorFactory, IIdeTracer tracer, bool enableSettingsCache)
 {
     this.testGeneratorFactory = testGeneratorFactory;
     this.tracer = tracer;
     this.enableSettingsCache = enableSettingsCache;
 }
コード例 #21
0
 public VsGeneratorServices(Project project, IConfigurationReader configurationReader, IIdeTracer tracer, IIntegrationOptionsProvider integrationOptionsProvider) :
     base( //TODO: load dependencies through DI
         new TestGeneratorFactory(),
         new OutOfProcessTestGeneratorFactory(integrationOptionsProvider.GetOptions()),
         new VsGeneratorInfoProvider(project, tracer, configurationReader),
         tracer, false)
 {
     this.project         = project;
     _configurationReader = configurationReader;
 }
コード例 #22
0
 public GoToStepsCommand(IServiceProvider serviceProvider, DTE dte, IProjectScopeFactory projectScopeFactory, IIdeTracer tracer) : base(serviceProvider, dte)
 {
     this.projectScopeFactory = projectScopeFactory;
     this.tracer = tracer;
 }
コード例 #23
0
 public RegistryStatusAccessor(IIdeTracer tracer, IDevBuildChecker devBuildChecker)
 {
     this.tracer      = tracer;
     _devBuildChecker = devBuildChecker;
 }
コード例 #24
0
 protected CommandBasedTestRunnerGateway(DTE dte, IIdeTracer tracer, bool delayedCodeBehindClose = false)
 {
     this.dte    = dte;
     this.tracer = tracer;
     this.delayedCodeBehindClose = delayedCodeBehindClose;
 }
コード例 #25
0
        public VsProjectFilesTracker(Project project, string regexPattern, DteWithEvents dteWithEvents, IIdeTracer tracer) : base(project, dteWithEvents, tracer)
        {
            fileNameRe = new Regex(regexPattern, RegexOptions.IgnoreCase);

            SubscribeToDteEvents();
        }
コード例 #26
0
 public TestRunnerGatewayProvider(IObjectContainer container, IIntegrationOptionsProvider integrationOptionsProvider, IIdeTracer tracer)
 {
     this.container = container;
     this.tracer    = tracer;
     this.integrationOptionsProvider = integrationOptionsProvider;
 }
コード例 #27
0
 public VS2012RunnerGateway_CodeBehind(DTE dte, IIdeTracer tracer)
     : base(dte, tracer, true)
 {
 }
コード例 #28
0
        public VsProjectFilesTracker(Project project, string regexPattern, DteWithEvents dteWithEvents, IIdeTracer tracer) : base(project, dteWithEvents, tracer)
        {
            fileNameRe = new Regex(regexPattern, RegexOptions.IgnoreCase);

            SubscribeToDteEvents();
        }
コード例 #29
0
 protected RemoteGeneratorServices(ITestGeneratorFactory testGeneratorFactory, IRemoteAppDomainTestGeneratorFactory remoteAppDomainTestGeneratorFactory, IGeneratorInfoProvider generatorInfoProvider, IIdeTracer tracer, bool enableSettingsCache)
     : base(testGeneratorFactory, tracer, enableSettingsCache)
 {
     this.remoteAppDomainTestGeneratorFactory = remoteAppDomainTestGeneratorFactory;
     this.generatorInfoProvider = generatorInfoProvider;
 }
コード例 #30
0
 public VsProjectReferencesTracker(Project project, DteWithEvents dteWithEvents, IIdeTracer tracer)
 {
     this.project       = project.Object as VSProject;
     this.dteWithEvents = dteWithEvents;
     this.tracer        = tracer;
     this.timer         = new Timer(HandleFilesChangedOnDisk, null, Timeout.Infinite, Timeout.Infinite);
     this.triggerReferenceChangedTimer = new Timer(TriggerReferenceChange, null, Timeout.Infinite, Timeout.Infinite);
 }
コード例 #31
0
 public VsSpecFlowConfigurationReader(Project project, IIdeTracer tracer) : base(tracer)
 {
     _project = project;
 }
コード例 #32
0
 public Vs2008SpecFlowConfigurationReader(Project project, IIdeTracer tracer) : base(tracer)
 {
     this.project = project;
 }
コード例 #33
0
 public VsGeneratorServices(Project project, ISpecFlowConfigurationReader configurationReader, IIdeTracer tracer) : base( //TODO: load dependencies through DI
         new TestGeneratorFactory(),
         new RemoteAppDomainTestGeneratorFactory(tracer),
         new VsGeneratorInfoProvider(project, tracer, configurationReader),
         tracer, false)
 {
     this.project             = project;
     this.configurationReader = configurationReader;
 }
コード例 #34
0
 public SharpDevelop4SpecFlowConfigurationReader(IProject project, IIdeTracer tracer) : base(tracer)
 {
     this.project = project;
 }
コード例 #35
0
 public ILBindingRegistryBuilder(IIdeTracer tracer)
 {
     this.tracer = tracer;
 }
コード例 #36
0
 protected CommandBasedTestRunnerGateway(DTE dte, IIdeTracer tracer, bool delayedCodeBehindClose = false)
 {
     this.dte = dte;
     this.tracer = tracer;
     this.delayedCodeBehindClose = delayedCodeBehindClose;
 }
コード例 #37
0
 protected CompletionCommandFilter(IWpfTextView textView, ICompletionBroker broker, IIdeTracer tracer)
 {
     this.tracer = tracer;
     TextView    = textView;
     Broker      = broker;
 }
コード例 #38
0
 public ReSharperTestRunnerGateway(DTE dte, IIdeTracer tracer)
     : base(dte, tracer)
 {
 }
コード例 #39
0
 public ReSharper5TestRunnerGateway(DTE dte, IIdeTracer tracer)
     : base(dte, tracer)
 {
 }
コード例 #40
0
 public VS2012RunnerGateway(IProjectScopeFactory projectScopeFactory, DTE dte, IIdeTracer tracer, IServiceProvider serviceProvider)
 {
     this.projectScopeFactory = projectScopeFactory;
     runnerGateway_CodeBehind = new VS2012RunnerGateway_CodeBehind(dte, tracer);
     runnerGateway_TestWindowInvoke = new VS2012RunnerGateway_TestWindowInvoke(dte, tracer, serviceProvider);
 }
コード例 #41
0
 public SharpDevelop4SpecFlowConfigurationReader(IProject project, IIdeTracer tracer) : base(tracer)
 {
     this.project = project;
 }
コード例 #42
0
 public VS2012RunnerGateway_CodeBehind(DTE dte, IIdeTracer tracer)
     : base(dte, tracer, true)
 {
 }
コード例 #43
0
 public VS2012RunnerGateway(IProjectScopeFactory projectScopeFactory, DTE dte, IIdeTracer tracer, IServiceProvider serviceProvider)
 {
     this.projectScopeFactory       = projectScopeFactory;
     runnerGateway_CodeBehind       = new VS2012RunnerGateway_CodeBehind(dte, tracer);
     runnerGateway_TestWindowInvoke = new VS2012RunnerGateway_TestWindowInvoke(dte, tracer, serviceProvider);
 }
コード例 #44
0
 public VS2012RunnerGateway_TestWindowInvoke(DTE dte, IIdeTracer tracer, IServiceProvider serviceProvider)
 {
     this.dte = dte;
     this.tracer = tracer;
     this.serviceProvider = serviceProvider;
 }
コード例 #45
0
 public VS2012RunnerGateway_TestWindowInvoke(DTE dte, IIdeTracer tracer, IServiceProvider serviceProvider)
 {
     this.dte             = dte;
     this.tracer          = tracer;
     this.serviceProvider = serviceProvider;
 }
コード例 #46
0
 public GherkinCompletionCommandFilter(IWpfTextView textView, ICompletionBroker broker, GherkinLanguageService languageService, IIdeTracer tracer) : base(textView, broker, tracer)
 {
     this.languageService = languageService;
 }
コード例 #47
0
 public VsBindingRegistryBuilder(IIdeTracer tracer)
 {
     this.tracer = tracer;
 }
コード例 #48
0
 protected CommandBasedTestRunnerGateway(DTE dte, IIdeTracer tracer)
 {
     this.dte = dte;
     this.tracer = tracer;
 }
コード例 #49
0
 protected RemoteGeneratorServices(ITestGeneratorFactory testGeneratorFactory, IRemoteAppDomainTestGeneratorFactory remoteAppDomainTestGeneratorFactory, IOutOfProcessTestGeneratorFactory outOfProcessTestGeneratorFactory, IGeneratorInfoProvider generatorInfoProvider, IIdeTracer tracer, bool enableSettingsCache)
     : base(testGeneratorFactory, tracer, enableSettingsCache)
 {
     _remoteAppDomainTestGeneratorFactory = remoteAppDomainTestGeneratorFactory;
     _outOfProcessTestGeneratorFactory    = outOfProcessTestGeneratorFactory;
     _generatorInfoProvider = generatorInfoProvider;
 }
コード例 #50
0
 public GoToStepsCommand(DTE dte, IProjectScopeFactory projectScopeFactory, IIdeTracer tracer)
 {
     this.dte = dte;
     this.projectScopeFactory = projectScopeFactory;
     this.tracer = tracer;
 }
コード例 #51
0
        protected VsProjectFileTrackerBase(Project project, DteWithEvents dteWithEvents, IIdeTracer tracer)
        {
            this.project       = project;
            this.dteWithEvents = dteWithEvents;
            this.tracer        = tracer;

            this.timer = new Timer(HandleFilesChangedOnDisk, null, Timeout.Infinite, Timeout.Infinite);
        }
 public GherkinCompletionCommandFilter(IWpfTextView textView, ICompletionBroker broker, GherkinLanguageService languageService, IIdeTracer tracer) : base(textView, broker, tracer)
 {
     this.languageService = languageService;
 }
コード例 #53
0
 public RemoteAppDomainTestGeneratorFactory(IIdeTracer tracer)
 {
     this.tracer = tracer;
     this.remoteGeneratorAssemblyName = typeof(ITestGeneratorFactory).Assembly.GetName().Name;
 }
コード例 #54
0
 public MsTestRunnerGateway(DTE dte, IIdeTracer tracer) : base(dte, tracer)
 {
 }
コード例 #55
0
ファイル: IIdeTracer.cs プロジェクト: mikeyjones/SpecFlow
        public static void Trace(this IIdeTracer tracer, string messageFormat, object category, params object[] messageArgs)
        {
            string categoryMessage = category is string?category.ToString() : category is Type ? ((Type)category).Name : category.GetType().Name;

            tracer.Trace(string.Format(messageFormat, messageArgs), categoryMessage);
        }
コード例 #56
0
        public static StepMap LoadFromFile(string fileName, IIdeTracer tracer)
        {
            try
            {
                var serializer = new StepMapSetializer();

                using (var reader = new StreamReader(fileName, Encoding.UTF8))
                {
                    var stepMap = serializer.Deserialize(reader);

                    if (stepMap.FileVersion != CURRENT_VERSION)
                    {
                        tracer.Trace(string.Format("StepMap has wrong file version"), typeof(StepMap).Name);
                        return null;
                    }

                    if (stepMap.IntegrationVersion != GetIntegrationVersion())
                    {
                        tracer.Trace(string.Format("StepMap file is generated by another SpecFlow version."), typeof(StepMap).Name);
                        return null;
                    }

                    tracer.Trace(string.Format("StepMap with {0} feature files and {1} step definitions loaded", stepMap.FeatureFileCount, stepMap.StepDefinitionCount), typeof(StepMap).Name);

                    return stepMap;
                }
            }
            catch(Exception loadException)
            {
                tracer.Trace(string.Format("StepMap loading error: {0}", loadException), typeof(StepMap).Name);
                return null;
            }
        }
コード例 #57
0
 public VsTestExplorerGateway(DTE dte, IIdeTracer tracer, IServiceProvider serviceProvider)
 {
     this.dte             = dte;
     this.tracer          = tracer;
     this.serviceProvider = serviceProvider;
 }
コード例 #58
0
 protected RemoteGeneratorServices(ITestGeneratorFactory testGeneratorFactory, IRemoteAppDomainTestGeneratorFactory remoteAppDomainTestGeneratorFactory, IGeneratorInfoProvider generatorInfoProvider, IIdeTracer tracer, bool enableSettingsCache)
     : base(testGeneratorFactory, tracer, enableSettingsCache)
 {
     this.remoteAppDomainTestGeneratorFactory = remoteAppDomainTestGeneratorFactory;
     this.generatorInfoProvider = generatorInfoProvider;
 }
コード例 #59
0
 public DelegateTask(Action task, IIdeTracer tracer)
 {
     this.task = task;
     this.tracer = tracer;
 }
コード例 #60
0
 protected FileBasedSpecFlowConfigurationReader(IIdeTracer tracer)
 {
     this.tracer = tracer;
 }