コード例 #1
0
        public void RunTests(IEnumerable <TestCase> tests, IRunContext runContext, IFrameworkHandle frameworkHandle)
        {
            frameworkHandle.SendMessage(TestMessageLevel.Informational, Strings.EXECUTOR_STARTING);
            int    executedSpecCount = 0;
            string currentAsssembly  = string.Empty;

            try
            {
                ISpecificationExecutor specificationExecutor = this.adapterFactory.CreateExecutor();
                IEnumerable <IGrouping <string, TestCase> > groupBySource = tests.GroupBy(x => x.Source);
                foreach (IGrouping <string, TestCase> grouping in groupBySource)
                {
                    currentAsssembly = grouping.Key;
                    frameworkHandle.SendMessage(TestMessageLevel.Informational, string.Format(Strings.EXECUTOR_EXECUTINGIN, currentAsssembly));
                    specificationExecutor.RunAssemblySpecifications(currentAsssembly, MSpecTestAdapter.uri, runContext, frameworkHandle, grouping);
                    executedSpecCount += grouping.Count();
                }

                frameworkHandle.SendMessage(TestMessageLevel.Informational, String.Format(Strings.EXECUTOR_COMPLETE, executedSpecCount, groupBySource.Count()));
            }
            catch (Exception ex)
            {
                frameworkHandle.SendMessage(TestMessageLevel.Error, string.Format(Strings.EXECUTOR_ERROR, currentAsssembly, ex.Message));
            }
            finally
            {
            }
        }
コード例 #2
0
        public GenericSteps(FeatureContext featureContext, SpecificationContext specContext)
        {
            _featureContext            = featureContext;
            _defaultCatalogIdentifiers = new Dictionary <string, Guid>();
            _specificationExecutor     = specContext.Executor;

            _specificationExecutor.Init(Dictionary.AggregateSchemaRegister)
            .Init(Dictionary.ProjectionSchemaRegister)
            .Init(Dictionary.QuerySchemaRegister);
        }
コード例 #3
0
 public SpecificationContext(FeatureContext featureContext, ScenarioContext scenarioContext)
 {
     if (featureContext.FeatureInfo.Tags.Contains("app") || scenarioContext.ScenarioInfo.Tags.Contains("app"))
     {
         // setup executor to startup the app
         Executor = new AppSpecificationExecutor();
     }
     else
     {
         Executor = new InMemorySpecificationExecutor();
     }
 }
        public MSpecTestAdapter(ISpecificationDiscoverer discoverer, ISpecificationExecutor executor)
        {
            if (executor == null)
                throw new ArgumentNullException(nameof(executor));
            if (discoverer == null)
                throw new ArgumentNullException(nameof(discoverer));

            this.executor = executor;
            this.discoverer = discoverer;
            // check if a version of visual studio that supports traits is running
            vsObjectModel = AppDomain.CurrentDomain.GetAssemblies().Where(x => x.FullName.StartsWith(VSObjectModelAssemblyName)).SingleOrDefault();
            if (vsObjectModel != null)
            {
                FileVersionInfo fileInfo = FileVersionInfo.GetVersionInfo(vsObjectModel.Location);
                if ((fileInfo.FileMajorPart == 11 && fileInfo.ProductBuildPart > 50727) || fileInfo.FileMajorPart >= 12)
                {
                    UseTraits = true;
                }
            }
        }
コード例 #5
0
        public MSpecTestAdapter(ISpecificationDiscoverer discoverer, ISpecificationExecutor executor)
        {
            if (executor == null)
            {
                throw new ArgumentNullException(nameof(executor));
            }
            if (discoverer == null)
            {
                throw new ArgumentNullException(nameof(discoverer));
            }

            this.executor   = executor;
            this.discoverer = discoverer;
            // check if a version of visual studio that supports traits is running
            vsObjectModel = AppDomain.CurrentDomain.GetAssemblies().Where(x => x.FullName.StartsWith(VSObjectModelAssemblyName)).SingleOrDefault();
            if (vsObjectModel != null)
            {
                FileVersionInfo fileInfo = FileVersionInfo.GetVersionInfo(vsObjectModel.Location);
                if ((fileInfo.FileMajorPart == 11 && fileInfo.ProductBuildPart > 50727) || fileInfo.FileMajorPart >= 12)
                {
                    UseTraits = true;
                }
            }
        }
コード例 #6
0
 public MSpecTestAdapter(ISpecificationDiscoverer discoverer, ISpecificationExecutor executor)
 {
     this.executor   = executor ?? throw new ArgumentNullException(nameof(executor));
     this.discoverer = discoverer ?? throw new ArgumentNullException(nameof(discoverer));
 }