本文整理汇总了C#中MSpecUnitTestProvider类的典型用法代码示例。如果您正苦于以下问题:C# MSpecUnitTestProvider类的具体用法?C# MSpecUnitTestProvider怎么用?C# MSpecUnitTestProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MSpecUnitTestProvider类属于命名空间,在下文中一共展示了MSpecUnitTestProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetOrCreateContextElement
public static ContextElement GetOrCreateContextElement(MSpecUnitTestProvider provider,
IProject project,
ProjectModelElementEnvoy projectEnvoy,
string typeName,
string assemblyLocation,
string subject,
ICollection<string> tags,
bool isIgnored)
{
#if RESHARPER_6
var id = ContextElement.CreateId(subject, typeName);
var contextElement = provider.UnitTestManager.GetElementById(project, id) as ContextElement;
if (contextElement != null)
{
contextElement.State = UnitTestElementState.Valid;
return contextElement;
}
#endif
return new ContextElement(provider,
projectEnvoy,
typeName,
assemblyLocation,
subject,
tags,
isIgnored);
}
示例2: GetOrCreateContextSpecification
public static ContextSpecificationElement GetOrCreateContextSpecification(MSpecUnitTestProvider provider,
IUnitTestElementManager manager,
PsiModuleManager psiModuleManager,
CacheManager cacheManager,
IProject project,
ContextElement context,
ProjectModelElementEnvoy projectEnvoy,
IClrTypeName declaringTypeName,
string fieldName,
bool isIgnored)
{
var id = ContextSpecificationElement.CreateId(context, fieldName);
var contextSpecification = manager.GetElementById(project, id) as ContextSpecificationElement;
if (contextSpecification != null)
{
contextSpecification.Parent = context;
contextSpecification.State = UnitTestElementState.Valid;
return contextSpecification;
}
return new ContextSpecificationElement(provider,
psiModuleManager,
cacheManager,
context,
projectEnvoy,
declaringTypeName,
fieldName,
isIgnored);
}
示例3: GetOrCreateBehaviorSpecification
public static BehaviorSpecificationElement GetOrCreateBehaviorSpecification(MSpecUnitTestProvider provider,
IUnitTestElementManager manager,
PsiModuleManager psiModuleManager,
CacheManager cacheManager,
IProject project,
BehaviorElement behavior,
ProjectModelElementEnvoy projectEnvoy,
IClrTypeName declaringTypeName,
string fieldName,
bool isIgnored)
{
var id = BehaviorSpecificationElement.CreateId(behavior, fieldName);
var behaviorSpecification = manager.GetElementById(project, id) as BehaviorSpecificationElement;
if (behaviorSpecification != null)
{
behaviorSpecification.Parent = behavior;
behaviorSpecification.State = UnitTestElementState.Valid;
return behaviorSpecification;
}
return new BehaviorSpecificationElement(provider,
psiModuleManager,
cacheManager,
behavior,
projectEnvoy,
declaringTypeName,
fieldName,
isIgnored);
}
示例4: FileExplorer
public FileExplorer(MSpecUnitTestProvider provider,
ElementFactories factories,
IFile file,
UnitTestElementLocationConsumer consumer,
Func<bool> interrupted)
{
if (file == null)
{
throw new ArgumentNullException("file");
}
if (provider == null)
{
throw new ArgumentNullException("provider");
}
_consumer = consumer;
_file = file;
_interrupted = interrupted;
var project = file.GetSourceFile().ToProjectFile().GetProject();
#if !RESHARPER_8
_assemblyPath = UnitTestManager.GetOutputAssemblyPath(project).FullPath;
#else
_assemblyPath = project.GetOutputFilePath().FullPath;
#endif
_elementHandlers = new List<IElementHandler>
{
new ContextElementHandler(factories),
new ContextSpecificationElementHandler(factories),
new BehaviorElementHandler(factories)
};
}
示例5: ReadFromXml
public static IUnitTestElement ReadFromXml(XmlElement parent, IUnitTestElement parentElement, MSpecUnitTestProvider provider, ISolution solution
#if RESHARPER_61
, IUnitTestElementManager manager, PsiModuleManager psiModuleManager, CacheManager cacheManager
#endif
)
{
var projectId = parent.GetAttribute("projectId");
var project = ProjectUtil.FindProjectElementByPersistentID(solution, projectId) as IProject;
if (project == null)
{
return null;
}
var behavior = parentElement as BehaviorElement;
if (behavior == null)
{
return null;
}
var typeName = parent.GetAttribute("typeName");
var methodName = parent.GetAttribute("methodName");
var isIgnored = bool.Parse(parent.GetAttribute("isIgnored"));
return BehaviorSpecificationFactory.GetOrCreateBehaviorSpecification(provider,
#if RESHARPER_61
manager, psiModuleManager, cacheManager,
#endif
project, behavior, ProjectModelElementEnvoy.Create(project), typeName, methodName, isIgnored);
}
示例6: 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);
}
示例7: ReadFromXml
public static IUnitTestElement ReadFromXml(XmlElement parent, IUnitTestElement parentElement, MSpecUnitTestProvider provider)
{
var projectId = parent.GetAttribute("projectId");
var project = ProjectUtil.FindProjectElementByPersistentID(provider.Solution, projectId) as IProject;
if (project == null)
{
return null;
}
var context = parentElement as ContextElement;
if (context == null)
{
return null;
}
var typeName = parent.GetAttribute("typeName");
var methodName = parent.GetAttribute("methodName");
var isIgnored = bool.Parse(parent.GetAttribute("isIgnored"));
var fullyQualifiedTypeName = parent.GetAttribute("typeFQN");
return Factories.BehaviorFactory.GetOrCreateBehavior(provider,
project,
ProjectModelElementEnvoy.Create(project),
context,
typeName,
methodName,
isIgnored,
fullyQualifiedTypeName);
}
示例8: 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);
}
示例9: 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
}
}
示例10: BehaviorSpecificationFactory
public BehaviorSpecificationFactory(MSpecUnitTestProvider provider, IProject project, ProjectModelElementEnvoy projectEnvoy)
{
#endif
_provider = provider;
_project = project;
_projectEnvoy = projectEnvoy;
}
示例11: GetOrCreateContext
public static ContextElement GetOrCreateContext(MSpecUnitTestProvider provider,
IUnitTestElementManager manager,
PsiModuleManager psiModuleManager,
CacheManager cacheManager,
IProject project,
ProjectModelElementEnvoy projectEnvoy,
IClrTypeName typeName,
string assemblyLocation,
string subject,
ICollection<string> tags,
bool isIgnored)
{
var id = ContextElement.CreateId(subject, typeName.FullName, tags);
var contextElement = manager.GetElementById(project, id) as ContextElement;
if (contextElement != null)
{
contextElement.State = UnitTestElementState.Valid;
return contextElement;
}
return new ContextElement(provider,
psiModuleManager,
cacheManager,
projectEnvoy,
typeName,
assemblyLocation,
subject,
tags,
isIgnored);
}
示例12: ContextFactory
public ContextFactory(MSpecUnitTestProvider provider, ProjectModelElementEnvoy projectEnvoy, string assemblyPath, ContextCache cache)
{
_provider = provider;
_cache = cache;
_projectEnvoy = projectEnvoy;
_assemblyPath = assemblyPath;
}
示例13: BehaviorFactory
public BehaviorFactory(MSpecUnitTestProvider provider, IProject project, ProjectModelElementEnvoy projectEnvoy, ContextCache cache)
{
_provider = provider;
_cache = cache;
_project = project;
_projectEnvoy = projectEnvoy;
}
示例14: ReadFromXml
public static IUnitTestElement ReadFromXml(XmlElement parent, IUnitTestElement parentElement, MSpecUnitTestProvider provider, ISolution solution
#if RESHARPER_61
, IUnitTestElementManager manager, PsiModuleManager psiModuleManager, CacheManager cacheManager
#endif
)
{
var projectId = parent.GetAttribute("projectId");
var project = ProjectUtil.FindProjectElementByPersistentID(solution, projectId) as IProject;
if (project == null)
{
return null;
}
var context = parentElement as ContextElement;
if (context == null)
{
return null;
}
var typeName = parent.GetAttribute("typeName");
var methodName = parent.GetAttribute("methodName");
var isIgnored = bool.Parse(parent.GetAttribute("isIgnored"));
return ContextSpecificationFactory.GetOrCreateContextSpecification(provider,
#if RESHARPER_61
manager, psiModuleManager, cacheManager,
#endif
project, context, ProjectModelElementEnvoy.Create(project), new ClrTypeName(typeName), methodName, EmptyArray<string>.Instance, isIgnored);
}
示例15: FileExplorer
public FileExplorer(MSpecUnitTestProvider provider,
ElementFactories factories,
IFile file,
IUnitTestElementsObserver consumer,
Func<bool> interrupted)
{
if (file == null)
{
throw new ArgumentNullException("file");
}
if (provider == null)
{
throw new ArgumentNullException("provider");
}
this._consumer = consumer;
this._file = file;
this._interrupted = interrupted;
var project = file.GetSourceFile().ToProjectFile().GetProject();
this._assemblyPath = project.GetOutputFilePath().FullPath;
this._elementHandlers = new List<IElementHandler>
{
new ContextElementHandler(factories),
new ContextSpecificationElementHandler(factories),
new BehaviorElementHandler(factories)
};
}