本文整理汇总了C#中UnitTestElementConsumer类的典型用法代码示例。如果您正苦于以下问题:C# UnitTestElementConsumer类的具体用法?C# UnitTestElementConsumer怎么用?C# UnitTestElementConsumer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UnitTestElementConsumer类属于命名空间,在下文中一共展示了UnitTestElementConsumer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: ExploreSpecificationContainer
private void ExploreSpecificationContainer(IProject project, SpecificationContainerElement container, UnitTestElementConsumer consumer, IMetadataTypeInfo metadataTypeInfo)
{
foreach (var field in metadataTypeInfo.GetFields())
{
if (!field.IsPublic)
continue;
var x = field.Name;
var methodElement = _elementFactory.GetOrCreateSpecificationElement(project, container, new ClrTypeName(metadataTypeInfo.FullyQualifiedName), x, string.Empty);
consumer(methodElement);
}
}
开发者ID:briandonahue,项目名称:simple-testing,代码行数:12,代码来源:SimpleTestingMetadataExplorer.cs
示例17: ExploreProject
public void ExploreProject(IProject project, UnitTestElementConsumer consumer)
{
var config = _environment.GetProject(project.ProjectFile.Location.FullPath).ConfigSettings;
if (config.StoryBasePath == null)
return;
var stories = GetStoriesForProject(config);
var projectElement = new StorEvilProjectElement(_provider, null, project, project.Name, config.AssemblyLocations);
consumer(projectElement);
AddStoriesToProject(project, consumer, projectElement, stories);
}
开发者ID:paulbatum,项目名称:storevil,代码行数:14,代码来源:StorEvilAssemblyExplorer.cs
示例18: AssemblyExplorer
public AssemblyExplorer(MSpecUnitTestProvider provider,
IMetadataAssembly assembly,
IProject project,
UnitTestElementConsumer consumer)
{
_provider = provider;
_assembly = assembly;
_project = project;
_consumer = consumer;
_contextFactory = new ContextFactory(_provider, _project, _assembly.Location);
_contextSpecificationFactory = new ContextSpecificationFactory(_provider, _project);
_behaviorFactory = new BehaviorFactory(_provider, _project);
_behaviorSpecificationFactory = new BehaviorSpecificationFactory(_provider, _project);
}
开发者ID:benlovell,项目名称:machine.specifications,代码行数:15,代码来源:AssemblyExplorer.cs
示例19: ExploreAssembly
public void ExploreAssembly(
IProject project,
IMetadataAssembly metadataAssembly,
UnitTestElementConsumer consumer,
ManualResetEvent exitEvent)
{
using (ReadLockCookie.Create())
{
if (project.GetModuleReferences().All(module => module.Name != "Fixie"))
return;
foreach (var metadataTypeInfo in GetExportedTypes(metadataAssembly.GetTypes()))
ExploreType(project, metadataAssembly, consumer, metadataTypeInfo);
}
}
开发者ID:jbogard,项目名称:ReSharperFixieRunner,代码行数:15,代码来源:TestMetadataExplorer.cs
示例20: ExploreAssembly
public void ExploreAssembly(IMetadataAssembly assembly, IProject project, UnitTestElementConsumer consumer)
{
var a = Assembly.LoadFrom(assembly.Location);
var specTypes = FilterToSpecs(a.GetTypes());
var elementFactory = new ElementFactory(project, consumer, _provider);
foreach (var type in specTypes)
{
var instance = Activator.CreateInstance(type);
var spec = (instance is ISpec) ? (ISpec)instance : new SpecWrapper(instance);
elementFactory.CreateContainerElements(spec);
}
}
开发者ID:davidmfoley,项目名称:bickle,代码行数:16,代码来源:BickleAssemblyExplorer.cs
注:本文中的UnitTestElementConsumer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论