Exemplo n.º 1
0
 public InstallServices(IGuidanceNotificationService notificationService, IIdeTracer tracer, IFileAssociationDetector fileAssociationDetector, IStatusAccessor statusAccessor, IAnalyticsTransmitter analyticsTransmitter)
 {
     this.notificationService = notificationService;
     this.tracer = tracer;
     this.fileAssociationDetector = fileAssociationDetector;
     this.statusAccessor          = statusAccessor;
     _analyticsTransmitter        = analyticsTransmitter;
     IdeIntegration = IdeIntegration.Unknown;
 }
Exemplo n.º 2
0
 public InstallServices(IGuidanceNotificationService notificationService, IIdeTracer tracer, IFileAssociationDetector fileAssociationDetector, IStatusAccessor statusAccessor, IAnalyticsTransmitter analyticsTransmitter, ICurrentExtensionVersionProvider currentExtensionVersionProvider, IDevBuildChecker devBuildChecker)
 {
     this.notificationService = notificationService;
     this.tracer = tracer;
     this.fileAssociationDetector     = fileAssociationDetector;
     this.statusAccessor              = statusAccessor;
     _analyticsTransmitter            = analyticsTransmitter;
     _currentExtensionVersionProvider = currentExtensionVersionProvider;
     _devBuildChecker = devBuildChecker;
     IdeIntegration   = IdeIntegration.Unknown;
 }
Exemplo n.º 3
0
 public MSBuildTaskAnalyticsTransmitter(
     IAnalyticsEventProvider analyticsEventProvider,
     IMSBuildInformationProvider msBuildInformationProvider,
     XrmFrameworkProjectInfo xrmFrameworkProjectInfo,
     IAnalyticsTransmitter analyticsTransmitter,
     ITaskLoggingWrapper taskLoggingWrapper)
 {
     _analyticsEventProvider     = analyticsEventProvider;
     _msBuildInformationProvider = msBuildInformationProvider;
     _xrmFrameworkProjectInfo    = xrmFrameworkProjectInfo;
     _analyticsTransmitter       = analyticsTransmitter;
     _taskLoggingWrapper         = taskLoggingWrapper;
 }
Exemplo n.º 4
0
 public MSBuildTaskAnalyticsTransmitter(
     IAnalyticsEventProvider analyticsEventProvider,
     IMSBuildInformationProvider msBuildInformationProvider,
     SpecFlowProjectInfo specFlowProjectInfo,
     IAnalyticsTransmitter analyticsTransmitter,
     ITaskLoggingWrapper taskLoggingWrapper)
 {
     _analyticsEventProvider     = analyticsEventProvider;
     _msBuildInformationProvider = msBuildInformationProvider;
     _specFlowProjectInfo        = specFlowProjectInfo;
     _analyticsTransmitter       = analyticsTransmitter;
     _taskLoggingWrapper         = taskLoggingWrapper;
 }
Exemplo n.º 5
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,
     ITestRunResultCollector testRunResultCollector,
     IAnalyticsEventProvider analyticsEventProvider,
     IAnalyticsTransmitter analyticsTransmitter,
     ITestRunnerManager testRunnerManager,
     IRuntimePluginTestExecutionLifecycleEventEmitter runtimePluginTestExecutionLifecycleEventEmitter,
     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;
     _testRunResultCollector      = testRunResultCollector;
     _analyticsEventProvider      = analyticsEventProvider;
     _analyticsTransmitter        = analyticsTransmitter;
     _testRunnerManager           = testRunnerManager;
     _runtimePluginTestExecutionLifecycleEventEmitter = runtimePluginTestExecutionLifecycleEventEmitter;
 }
Exemplo n.º 6
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);
 }
Exemplo n.º 7
0
        public PluginTracker(IAnalyticsTransmitter transmitter)
        {
            var appDataFolder  = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            var specFlowFolder = Path.Combine(appDataFolder, "SpecFlow");
            var specflowRiderPluginFilePath = Path.Combine(specFlowFolder, "specflowriderplugin.json");
            var today = DateTime.Today;
            RiderInstallationStatus statusData;
            var currentPluginVersion = Assembly.GetExecutingAssembly().GetName().Version;

            if (!File.Exists(specflowRiderPluginFilePath))
            {
                transmitter.TransmitRuntimeEvent(new GenericEvent("Rider Extension installed"));
                statusData = new RiderInstallationStatus()
                {
                    InstallDate      = today,
                    InstalledVersion = currentPluginVersion.ToString(),
                    LastUsedDate     = today,
                    UsageDays        = 1
                };
            }
            else
            {
                statusData = JsonConvert.DeserializeObject <RiderInstallationStatus>(
                    File.ReadAllText(specflowRiderPluginFilePath));
            }

            if (statusData.LastUsedDate != today)
            {
                statusData.UsageDays++;
                statusData.LastUsedDate = today;
            }

            if (new Version(statusData.InstalledVersion) < currentPluginVersion)
            {
                transmitter.TransmitRuntimeEvent(new GenericEvent("Rider Extension upgraded", new Dictionary <string, string>()
                {
                    { "OldExtensionVersion", statusData.InstalledVersion }
                }));
                statusData.InstallDate      = today;
                statusData.InstalledVersion = currentPluginVersion.ToString();
            }

            File.WriteAllText(specflowRiderPluginFilePath, JsonConvert.SerializeObject(statusData));

            transmitter.TransmitRuntimeEvent(new GenericEvent("Rider Extension loaded"));
        }
        public WizardImplementation()
        {
            TelemetryConfiguration.Active.InstrumentationKey = AppInsightsInstrumentationKey.Key;

            try
            {
                var defaultDependencyProvider = new DefaultDependencyProvider();
                var container = new ObjectContainer();
                defaultDependencyProvider.RegisterDependencies(container);
                container.RegisterTypeAs <DefaultOptOutDataCollectionOptionsProvider, IIntegrationOptionsProvider>();
                container.RegisterTypeAs <EmptyServiceProvider, IServiceProvider>();

                _analyticsTransmitter = container.Resolve <IAnalyticsTransmitter>();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Exemplo n.º 9
0
 public GenerateFeatureFileCodeBehindTaskConfiguration(IAnalyticsTransmitter overrideAnalyticsTransmitter, IFeatureFileCodeBehindGenerator overrideFeatureFileCodeBehindGenerator)
 {
     OverrideAnalyticsTransmitter           = overrideAnalyticsTransmitter;
     OverrideFeatureFileCodeBehindGenerator = overrideFeatureFileCodeBehindGenerator;
 }
Exemplo n.º 10
0
 public SolutionTracker(ISolution solution, ISolutionLoadTasksScheduler solutionLoadTasksScheduler, IAnalyticsTransmitter transmitter)
 {
     solutionLoadTasksScheduler.EnqueueTask(new SolutionLoadTask("SpecFlow", SolutionLoadTaskKinds.Done, () =>
     {
         var projects = ((SolutionElement)solution).GetAllProjects();
         foreach (var project in projects)
         {
             var targetFrameworks = project.TargetFrameworkIds;
             var assemblies       = project.GetModuleReferences(targetFrameworks.First());
             if (assemblies.Any(a => a.Name == "TechTalk.SpecFlow"))
             {
                 transmitter.TransmitRuntimeEvent(new GenericEvent("Rider SpecFlow loaded", new Dictionary <string, string>()
                 {
                     { "ProjectTargetFramework", string.Join(";", targetFrameworks.Select(t => t.PresentableString)) }
                 }));
             }
         }
     }
                                                                 ));
 }