本文整理汇总了C#中Machine.Specifications.ReSharperRunner.Presentation.ContextElement类的典型用法代码示例。如果您正苦于以下问题:C# ContextElement类的具体用法?C# ContextElement怎么用?C# ContextElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ContextElement类属于Machine.Specifications.ReSharperRunner.Presentation命名空间,在下文中一共展示了ContextElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetOrCreateContextSpecification
public static ContextSpecificationElement GetOrCreateContextSpecification(MSpecUnitTestProvider provider,
IProject project,
ContextElement context,
ProjectModelElementEnvoy projectEnvoy,
string declaringTypeName,
string fieldName,
ICollection<string> tags,
bool isIgnored)
{
#if RESHARPER_6
var id = ContextSpecificationElement.CreateId(context, fieldName);
var contextSpecification = provider.UnitTestManager.GetElementById(project, id) as ContextSpecificationElement;
if (contextSpecification != null)
{
contextSpecification.Parent = context;
contextSpecification.State = UnitTestElementState.Valid;
return contextSpecification;
}
#endif
return new ContextSpecificationElement(provider,
context,
projectEnvoy,
declaringTypeName,
fieldName,
tags,
isIgnored);
}
示例2: GetOrCreateBehavior
public static BehaviorElement GetOrCreateBehavior(MSpecUnitTestProvider provider,
IProject project,
ProjectModelElementEnvoy projectEnvoy,
ContextElement context,
string declaringTypeName,
string fieldName,
bool isIgnored,
string fullyQualifiedTypeName)
{
#if RESHARPER_6
var id = BehaviorElement.CreateId(context, fieldName);
var behavior = provider.UnitTestManager.GetElementById(project, id) as BehaviorElement;
if (behavior != null)
{
behavior.Parent = context;
behavior.State = UnitTestElementState.Valid;
return behavior;
}
#endif
return new BehaviorElement(provider,
context,
projectEnvoy,
declaringTypeName,
fieldName,
isIgnored,
fullyQualifiedTypeName);
}
示例3: PresentContext
protected virtual void PresentContext(ContextElement element,
IPresentableItem item,
TreeModelNode modelNode,
PresentationState state)
{
PresentItem(item, element, state, UnitTestElementImage.TestContainer);
}
示例4: CreateContextSpecification
public ContextSpecificationElement CreateContextSpecification(ContextElement context, IMetadataField specification)
{
return GetOrCreateContextSpecification(context,
_reflectionTypeNameCache.GetClrName(specification.DeclaringType),
specification.Name,
specification.IsIgnored());
}
示例5: CreateContextTask
public UnitTestTask CreateContextTask(ContextElement context)
{
return new UnitTestTask(context,
new ContextTask(_providerId,
context.AssemblyLocation,
context.GetTypeClrName().FullName));
}
示例6: CreateContextTask
public UnitTestTask CreateContextTask(ContextElement context, bool isExplicit)
{
return new UnitTestTask(context,
new ContextTask(_providerId,
context.AssemblyLocation,
context.GetTypeClrName(),
false));
}
示例7: CreateContextSpecificationTask
public UnitTestTask CreateContextSpecificationTask(ContextElement context,
ContextSpecificationElement contextSpecification)
{
return new UnitTestTask(contextSpecification,
new ContextSpecificationTask(_providerId,
context.AssemblyLocation,
context.GetTypeClrName().FullName,
contextSpecification.FieldName));
}
示例8: CreateContextSpecification
public ContextSpecificationElement CreateContextSpecification(ContextElement context, IMetadataField specification)
{
return new ContextSpecificationElement(_provider,
context,
_projectEnvoy,
specification.DeclaringType.FullyQualifiedName,
specification.Name,
specification.IsIgnored());
}
示例9: CreateBehaviorTask
public UnitTestTask CreateBehaviorTask(ContextElement context, BehaviorElement behavior, bool isExplicit)
{
return new UnitTestTask(behavior,
new BehaviorTask(_providerId,
context.AssemblyLocation,
context.GetTypeClrName(),
behavior.FieldName,
false));
}
示例10: ContextSpecificationElement
public ContextSpecificationElement(IUnitTestProvider provider,
// ReSharper disable SuggestBaseTypeForParameter
ContextElement context,
// ReSharper restore SuggestBaseTypeForParameter
IProjectModelElement project,
string declaringTypeName,
string fieldName,
bool isIgnored)
: base(provider, context, project, declaringTypeName, fieldName, isIgnored || context.IsExplicit)
{
}
示例11: AddContext
public void AddContext(ITypeElement type, ContextElement context)
{
if (!_contexts.ContainsKey(type))
{
_contexts.Add(type, context);
}
else
{
_contexts[type] = context;
}
}
示例12: CreateBehaviorSpecificationTask
public UnitTestTask CreateBehaviorSpecificationTask(ContextElement context,
BehaviorSpecificationElement behaviorSpecification)
{
return new UnitTestTask(behaviorSpecification,
new BehaviorSpecificationTask(_providerId,
context.AssemblyLocation,
context.GetTypeClrName().FullName,
behaviorSpecification.Behavior.FieldName,
behaviorSpecification.FieldName,
behaviorSpecification.Behavior.FieldType));
}
示例13: CreateBehavior
public BehaviorElement CreateBehavior(ContextElement context, IMetadataField behavior)
{
IMetadataTypeInfo typeContainingBehaviorSpecifications = behavior.GetFirstGenericArgument();
return new BehaviorElement(_provider,
context,
_projectEnvoy,
behavior.DeclaringType.FullyQualifiedName,
behavior.Name,
behavior.IsIgnored() || typeContainingBehaviorSpecifications.IsIgnored());
}
示例14: BehaviorElement
public BehaviorElement(IUnitTestProvider provider,
// ReSharper disable SuggestBaseTypeForParameter
ContextElement context,
// ReSharper restore SuggestBaseTypeForParameter
ProjectModelElementEnvoy projectEnvoy,
string declaringTypeName,
string fieldName,
bool isIgnored)
: base(provider, context, projectEnvoy, declaringTypeName, fieldName, isIgnored || context.IsExplicit)
{
}
示例15: CreateContextSpecification
public ContextSpecificationElement CreateContextSpecification(ContextElement context, IMetadataField specification)
{
return GetOrCreateContextSpecification(_provider,
_manager,
_psiModuleManager,
_cacheManager,
_project,
context,
_projectEnvoy,
_reflectionTypeNameCache.GetClrName(specification.DeclaringType),
specification.Name,
specification.IsIgnored());
}