当前位置: 首页>>代码示例>>C#>>正文


C# UnitTestElementConsumer类代码示例

本文整理汇总了C#中UnitTestElementConsumer的典型用法代码示例。如果您正苦于以下问题:C# UnitTestElementConsumer类的具体用法?C# UnitTestElementConsumer怎么用?C# UnitTestElementConsumer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UnitTestElementConsumer类属于命名空间,在下文中一共展示了UnitTestElementConsumer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExploreAssembly

        public void ExploreAssembly(IProject project, IMetadataAssembly assembly, UnitTestElementConsumer consumer, ManualResetEvent exitEvent)
        {
            var envoy = ProjectModelElementEnvoy.Create(project);
            if (assembly.ReferencedAssembliesNames.Any(n => n.Name == SilverlightMsTestAssemblyName))
            {
                var allElements = new List<IUnitTestElement>();
                var mappedElements = new Dictionary<IUnitTestElement, IUnitTestElement>();

                new mstestlegacy::JetBrains.ReSharper.UnitTestProvider.MSTest.MsTestMetadataExplorer(msTestElementFactory, msTestAttributesProvider, project, shellLocks, allElements.Add)
                    .ExploreAssembly(assembly);

                foreach (var classElement in allElements.OfType<mstest10::JetBrains.ReSharper.UnitTestProvider.MSTest10.MsTestTestClassElement>())
                    mappedElements.Add(classElement, elementFactory.GetOrCreateClassElement(classElement.TypeName, project, envoy));

                foreach (var methodElement in allElements.OfType<mstest10::JetBrains.ReSharper.UnitTestProvider.MSTest10.MsTestTestMethodElement>())
                    mappedElements.Add(methodElement, elementFactory.GetOrCreateMethodElement(methodElement.Id, project, (mstestlegacy::JetBrains.ReSharper.UnitTestProvider.MSTest.MsTestTestClassElementBase)mappedElements[methodElement.Parent], envoy, methodElement.TypeName));

                foreach (var rowElement in allElements.OfType<mstest10::JetBrains.ReSharper.UnitTestProvider.MSTest10.MsTestTestRowElement>())
                    mappedElements.Add(rowElement, elementFactory.GetOrCreateRowElement(rowElement.Id, project, (mstestlegacy::JetBrains.ReSharper.UnitTestProvider.MSTest.MsTestTestMethodElementBase)mappedElements[rowElement.Parent], envoy));

                foreach (var element in allElements)
                {
                    IUnitTestElement mappedElement;
                    if (mappedElements.TryGetValue(element, out mappedElement))
                        consumer(mappedElements[element]);
                    else
                        consumer(element);
                }

            }
        }
开发者ID:archnaut,项目名称:AgUnit,代码行数:31,代码来源:SilverlightMsTestMetadataExplorer.cs

示例2: AddStoriesToProject

 private void AddStoriesToProject(IProject project, UnitTestElementConsumer consumer, StorEvilProjectElement projectElement, IEnumerable<Story> stories)
 {
     foreach (Story story in stories)
     {
         AddStoryElement(story, project, consumer, projectElement);
     }
 }
开发者ID:paulbatum,项目名称:storevil,代码行数:7,代码来源:StorEvilAssemblyExplorer.cs

示例3: AssemblyExplorer

    public AssemblyExplorer(MSpecUnitTestProvider provider,
#if RESHARPER_61
                            IUnitTestElementManager manager,
                            PsiModuleManager psiModuleManager,
                            CacheManager cacheManager,
#endif
                            IMetadataAssembly assembly,
                            IProject project,
                            UnitTestElementConsumer consumer)
    {
      _assembly = assembly;
      _consumer = consumer;

      using (ReadLockCookie.Create())
      {
        var projectEnvoy = new ProjectModelElementEnvoy(project);

        var cache = new ContextCache();
#if RESHARPER_61
        _contextFactory = new ContextFactory(provider, manager, psiModuleManager, cacheManager, project, projectEnvoy, _assembly.Location.FullPath, cache);
        _contextSpecificationFactory = new ContextSpecificationFactory(provider, manager, psiModuleManager, cacheManager, project, projectEnvoy, cache);
        _behaviorFactory = new BehaviorFactory(provider, manager, psiModuleManager, cacheManager, project, projectEnvoy, cache);
        _behaviorSpecificationFactory = new BehaviorSpecificationFactory(provider, manager, psiModuleManager, cacheManager, project, projectEnvoy);
#else
#if RESHARPER_6
        _contextFactory = new ContextFactory(provider, project, projectEnvoy, _assembly.Location.FullPath, cache);
#else
        _contextFactory = new ContextFactory(provider, project, projectEnvoy, _assembly.Location, cache);
#endif
        _contextSpecificationFactory = new ContextSpecificationFactory(provider, project, projectEnvoy, cache);
        _behaviorFactory = new BehaviorFactory(provider, project, projectEnvoy, cache);
        _behaviorSpecificationFactory = new BehaviorSpecificationFactory(provider, project, projectEnvoy);
#endif
      }
    }
开发者ID:jleo3,项目名称:machine.specifications,代码行数:35,代码来源:AssemblyExplorer.cs

示例4: Explore

    public void Explore(IProject project, IMetadataAssembly assembly, UnitTestElementConsumer consumer, IMetadataTypeInfo metadataTypeInfo)
    {
      if (!metadataTypeInfo.IsContext())
      {
        return;
      }

      var contextElement = _factories.Contexts.CreateContext(project, assembly.Location.FullPath, metadataTypeInfo);

      consumer(contextElement);

      metadataTypeInfo.GetSpecifications()
          .ForEach(x => consumer(_factories.ContextSpecifications.CreateContextSpecification(contextElement, x)));


      metadataTypeInfo.GetBehaviors().ForEach(x =>
      {
        var behaviorElement = _factories.Behaviors.CreateBehavior(contextElement, x);
        consumer(behaviorElement);


        _factories.BehaviorSpecifications
                    .CreateBehaviorSpecificationsFromBehavior(behaviorElement, x)
                    .ForEach(y => consumer(y));
      });
    }
开发者ID:hennys,项目名称:machine.specifications,代码行数:26,代码来源:AssemblyExplorer.cs

示例5: Explore

    public void Explore(IProject project, IMetadataAssembly assembly, UnitTestElementConsumer consumer)
    {
      if (!assembly.ReferencedAssembliesNames.Any(x => String.Equals(
                                                                     x.Name,
                                                                     typeof(It).Assembly.GetName().Name,
                                                                     StringComparison.InvariantCultureIgnoreCase)))
      {
        return;
      }

      assembly.GetTypes().Where(type => type.IsContext()).ForEach(type =>
      {
        var contextElement = _factories.Contexts.CreateContext(project,assembly.Location.FullPath, type);
        consumer(contextElement);

        type
          .GetSpecifications()
          .ForEach(x => consumer(_factories.ContextSpecifications.CreateContextSpecification(contextElement, x)));

        type.GetBehaviors().ForEach(x =>
        {
          var behaviorElement = _factories.Behaviors.CreateBehavior(contextElement, x);
          consumer(behaviorElement);

          _factories.BehaviorSpecifications
                    .CreateBehaviorSpecificationsFromBehavior(behaviorElement, x)
                    .ForEach(y => consumer(y));
        });
      });
    }
开发者ID:agross,项目名称:machine.specifications,代码行数:30,代码来源:AssemblyExplorer.cs

示例6: ExploreAssembly

 public void ExploreAssembly(IProject project,
                             IMetadataAssembly assembly,
                             UnitTestElementConsumer consumer,
                             ManualResetEvent exitEvent)
 {
   ExploreAssembly(project, assembly, consumer);
 }
开发者ID:agross,项目名称:machine.specifications,代码行数:7,代码来源:MSpecTestMetadataExplorer.8.0.cs

示例7: ExploreAssembly

    public void ExploreAssembly(IProject project, IMetadataAssembly assembly, UnitTestElementConsumer consumer)
    {
      new AssemblyExplorer(_provider,
#if RESHARPER_61
        _manager, _psiModuleManager, _cacheManager, 
#endif
        assembly, project, consumer).Explore();
    }
开发者ID:simonlaroche,项目名称:Simple.Testing,代码行数:8,代码来源:TestMetadataExplorer.cs

示例8: MetadataExplorer

 public MetadataExplorer(IUnitTestProvider provider, ISolution solution, IProject project, UnitTestElementConsumer consumer)
 {
     testProvider = provider;
     this.consumer = consumer;
     this.project = project;
     this.solution = solution;
     projectModel = new ProjectModelElementEnvoy(this.project);
 }
开发者ID:AngelPortal,项目名称:NBehave,代码行数:8,代码来源:MetadataExplorer.cs

示例9: ExploreAssembly

 public void ExploreAssembly(IProject project, IMetadataAssembly assembly, UnitTestElementConsumer consumer)
 {
   using (ReadLockCookie.Create()) //Get a read lock so that it is safe to read the assembly
   {
     foreach (var metadataTypeInfo in GetTypesIncludingNested(assembly.GetTypes()))
       this._assemblyExplorer.Explore(project, assembly, consumer, metadataTypeInfo);
   }
 }
开发者ID:hennys,项目名称:machine.specifications,代码行数:8,代码来源:MSpecTestMetadataExplorer.cs

示例10: ExploreAssembly

 // ReSharper 8.0
 public void ExploreAssembly(IProject project, IMetadataAssembly assembly, UnitTestElementConsumer consumer, ManualResetEvent exitEvent)
 {
     // TODO: Monitor exitEvent to stop processing. Note that nunit currently ignores it, too
     using (ReadLockCookie.Create())
     {
         foreach (var metadataTypeInfo in GetExportedTypes(assembly.GetTypes()))
             ExploreType(project, assembly, consumer, metadataTypeInfo);
     }
 }
开发者ID:EddieGarmon,项目名称:resharper-xunit,代码行数:10,代码来源:XunitTestMetadataExplorer.cs

示例11: ExploreAssembly

        public void ExploreAssembly(IProject project, IMetadataAssembly assembly, UnitTestElementConsumer consumer)
        {
            var types = GetExportedTypes(assembly.GetTypes()).ToArray();

            foreach (var metadataTypeInfo in types)
            {
                ExploreType(project, assembly, consumer, metadataTypeInfo);
            }
        }
开发者ID:briandonahue,项目名称:simple-testing,代码行数:9,代码来源:SimpleTestingMetadataExplorer.cs

示例12: AddScenarioElement

 private void AddScenarioElement(IProject project, UnitTestElementConsumer consumer,
     StorEvilStoryElement storyElement, IScenario scenario)
 {
     if (scenario is Scenario)
         consumer(new StorEvilScenarioElement(_provider, storyElement, project, scenario.Name, (Scenario)scenario));
     else
         consumer(new StorEvilScenarioOutlineElement(_provider, storyElement, project, scenario.Name,
                                                     (ScenarioOutline)scenario));
 }
开发者ID:pawelpabich,项目名称:storevil,代码行数:9,代码来源:StorEvilAssemblyExplorer.cs

示例13: XunitMetadataExplorer

 public XunitMetadataExplorer([NotNull] XunitElementFactory factory, IShellLocks shellLocks, IProject project, UnitTestElementConsumer consumer)
 {
     if (factory == null) throw new ArgumentNullException("factory");
     this.project = project;
     this.consumer = consumer;
     this.shellLocks = shellLocks;
     this.factory = factory;
     envoy = ProjectModelElementEnvoy.Create(project);
 }
开发者ID:hazzik,项目名称:ReSharper.XUnitTestRunner,代码行数:9,代码来源:XUnitMetadataExplorer.cs

示例14: AddStoryElement

        private void AddStoryElement(Story story, IProject project,
            UnitTestElementConsumer consumer, StorEvilProjectElement parent)
        {
            var storyElement = GetStoryElement(parent, project, story);
            consumer(storyElement);

            foreach (IScenario scenario in story.Scenarios)
                AddScenarioElement(project, consumer, storyElement, scenario);
        }
开发者ID:pawelpabich,项目名称:storevil,代码行数:9,代码来源:StorEvilAssemblyExplorer.cs

示例15: ExploreType

 private void ExploreType(IProject project, IMetadataAssembly assembly, UnitTestElementConsumer consumer, IMetadataTypeInfo metadataTypeInfo)
 {
     // It would be nice to use TestClassCommandFactory.Make(...), but that doesn't work
     // with RunWith, since Make ends up calling TypeUtility.GetRunWith, which tries to
     // call IAttributeInfo.GetInstance<RunWithAttribute>, and we can't support that.
     // So we'll break down Make and do it ourselves. If the runner finds any methods
     // that we don't find, it will create them at runtime
     var typeInfo = metadataTypeInfo.AsTypeInfo();
     if (TypeUtility.IsTestClass(typeInfo))
         ExploreTestClass(project, assembly, consumer, typeInfo, metadataTypeInfo.FullyQualifiedName);
 }
开发者ID:EddieGarmon,项目名称:resharper-xunit,代码行数:11,代码来源:XunitTestMetadataExplorer.cs


注:本文中的UnitTestElementConsumer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。