本文整理汇总了C#中UnitTestElement类的典型用法代码示例。如果您正苦于以下问题:C# UnitTestElement类的具体用法?C# UnitTestElement怎么用?C# UnitTestElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UnitTestElement类属于命名空间,在下文中一共展示了UnitTestElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StorEvilProjectElement
public StorEvilProjectElement(StorEvilTestProvider provider, UnitTestElement parent, IProject project,
string title, IEnumerable<string> assemblies)
: base(provider, parent, project, title)
{
Assemblies = assemblies;
_namespace = new UnitTestNamespace(project.Name + ": StorEvil specifications");
}
示例2: StorEvilScenarioElement
public StorEvilScenarioElement(StorEvilTestProvider provider, UnitTestElement parent, IProject project,
string title, Scenario scenario)
: base(provider, parent, project, title)
{
_namespace = new UnitTestNamespace(project.Name);
Scenario = scenario;
}
示例3: BuildDisposition
public static UnitTestElementDisposition BuildDisposition(UnitTestElement element, ScenarioLocation location, IProjectFile projectFile)
{
var contents = File.ReadAllText(location.Path);
var range = new TextRange(LineToOffset(contents, location.FromLine), LineToOffset(contents, location.ToLine));
return new UnitTestElementDisposition(element, projectFile, range, new TextRange(0));
}
示例4: StorEvilUnitTestElement
protected StorEvilUnitTestElement(IUnitTestProvider provider, UnitTestElement parent, IProject project,
string title)
: base(provider, parent)
{
Project = project;
_title = title;
}
示例5: GetTasks
public IList<UnitTestTask> GetTasks(UnitTestElement element, IList<UnitTestElement> explicitElements)
{
//if (!(element is StorEvilScenarioElement))
// return new List<UnitTestTask>();
var tasks = new List<UnitTestTask>();
if (element is StorEvilProjectElement)
{
var projectEl = element as StorEvilProjectElement;
tasks.Add(new UnitTestTask(null, new LoadContextAssemblyTask(typeof(Scenario).Assembly.Location)));
foreach (string assembly in projectEl.Assemblies)
{
tasks.Add(new UnitTestTask(null, new LoadContextAssemblyTask(assembly)));
}
tasks.Add(GetProjectTask(projectEl, explicitElements));
}
if (element is StorEvilStoryElement)
{
tasks.Add(GetProjectTask(element.Parent as StorEvilProjectElement, explicitElements));
tasks.Add(GetStoryTask(element as StorEvilStoryElement, explicitElements));
}
if (element is StorEvilScenarioElement)
{
tasks.Add(GetProjectTask(element.Parent.Parent as StorEvilProjectElement, explicitElements));
tasks.Add(GetStoryTask(element.Parent as StorEvilStoryElement, explicitElements));
tasks.Add(GetScenarioTask(element, explicitElements));
}
return tasks;
}
示例6: StorEvilStoryElement
public StorEvilStoryElement(StorEvilTestProvider provider, UnitTestElement parent, IProject project, string title, ConfigSettings config, string id)
: base(provider, parent, project, title)
{
Config = config;
Id = id;
_namespace = new UnitTestNamespace(project.Name + " " + title);
}
示例7: Element
protected Element(IUnitTestProvider provider,
UnitTestElement parent,
ProjectModelElementEnvoy projectEnvoy,
string declaringTypeName,
bool isIgnored)
: base(provider, parent)
{
if (projectEnvoy == null && !Shell.Instance.IsTestShell)
{
throw new ArgumentNullException("projectEnvoy");
}
if (declaringTypeName == null)
{
throw new ArgumentNullException("declaringTypeName");
}
_projectEnvoy = projectEnvoy;
_declaringTypeName = declaringTypeName;
if (isIgnored)
{
SetExplicit("Ignored");
}
}
示例8: StorEvilScenarioOutlineElement
public StorEvilScenarioOutlineElement(StorEvilTestProvider provider, UnitTestElement parent, IProject project,
string title, ScenarioOutline scenarioOutline)
: base(provider, parent, project, title)
{
_scenarioOutline = scenarioOutline;
_namespace = new UnitTestNamespace(project.Name);
}
示例9: StorEvilStoryElement
public StorEvilStoryElement(StorEvilTestProvider provider, UnitTestElement parent, IProject project, string title, string path)
: base(provider, parent, project, title)
{
_path = path;
_namespace = new UnitTestNamespace(project.Name + " " + title);
}
示例10: AddStoryElement
private void AddStoryElement(Story story, IProject project,
UnitTestElementConsumer consumer, UnitTestElement parent)
{
var storyElement = GetStoryElement(parent, project, story);
consumer(storyElement);
foreach (IScenario scenario in story.Scenarios)
AddScenarioElement(project, consumer, storyElement, scenario);
}
示例11: GetTaskSequence
public IList<UnitTestTask> GetTaskSequence(UnitTestElement element, IList<UnitTestElement> explicitElements)
{
if (element is ContextSpecificationElement)
{
var contextSpecification = element as ContextSpecificationElement;
var context = contextSpecification.Context;
return new List<UnitTestTask>
{
_taskFactory.CreateAssemblyLoadTask(context),
_taskFactory.CreateContextTask(context, explicitElements.Contains(context)),
_taskFactory.CreateContextSpecificationTask(context,
contextSpecification,
explicitElements.Contains(contextSpecification))
};
}
if (element is BehaviorElement)
{
var behavior = element as BehaviorElement;
var context = behavior.Context;
return new List<UnitTestTask>
{
_taskFactory.CreateAssemblyLoadTask(context),
_taskFactory.CreateContextTask(context, explicitElements.Contains(context)),
_taskFactory.CreateBehaviorTask(context, behavior, explicitElements.Contains(behavior))
};
}
if (element is BehaviorSpecificationElement)
{
var behaviorSpecification = element as BehaviorSpecificationElement;
var behavior = behaviorSpecification.Behavior;
var context = behavior.Context;
return new List<UnitTestTask>
{
_taskFactory.CreateAssemblyLoadTask(context),
_taskFactory.CreateContextTask(context, explicitElements.Contains(context)),
_taskFactory.CreateBehaviorTask(context,
behavior,
explicitElements.Contains(behavior)),
_taskFactory.CreateBehaviorSpecificationTask(context,
behaviorSpecification,
explicitElements.Contains(behaviorSpecification))
};
}
if (element is ContextElement)
{
return EmptyArray<UnitTestTask>.Instance;
}
throw new ArgumentException(String.Format("Element is not a Machine.Specifications element: '{0}'", element));
}
示例12: StorEvilStoryElement
public StorEvilStoryElement(StorEvilTestProvider provider, UnitTestElement parent, IProject project, string title, string path)
: base(provider, parent, project, title)
{
_path = path;
var root = project.Location.ToDirectoryInfo().FullName;
var pathPieces = PathHelper.GetRelativePathPieces(root, _path);
var pathJoined = project.Name + " " + string.Join(" - ", pathPieces);
_namespace = new UnitTestNamespace(pathJoined + title);
}
示例13: IsOfKind
public bool IsOfKind(UnitTestElement element, UnitTestElementKind elementKind)
{
if (element is StorEvilScenarioElement)
return elementKind == UnitTestElementKind.Test;
if (element is StorEvilStoryElement || element is StorEvilProjectElement)
return elementKind == UnitTestElementKind.TestContainer;
return false;
}
示例14: FieldElement
protected FieldElement(IUnitTestProvider provider,
UnitTestElement parent,
IProjectModelElement project,
string declaringTypeName,
string fieldName,
bool isIgnored)
: base(provider, parent, project, declaringTypeName, isIgnored || parent.IsExplicit)
{
_fieldName = fieldName;
}
示例15: FieldElement
protected FieldElement(IUnitTestProvider provider,
UnitTestElement parent,
IProjectModelElement project,
string declaringTypeName,
string fieldName,
bool isIgnored)
: base(provider, parent, project, declaringTypeName, isIgnored || parent.IsExplicit)
{
_fieldName = fieldName;
AssignCategories(parent.GetCategories().Select(x => x.Name).ToList());
}