本文整理汇总了C#中IUnitTestElement类的典型用法代码示例。如果您正苦于以下问题:C# IUnitTestElement类的具体用法?C# IUnitTestElement怎么用?C# IUnitTestElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IUnitTestElement类属于命名空间,在下文中一共展示了IUnitTestElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
示例2: ReadFromXml
public static IUnitTestElement ReadFromXml(XmlElement parent,
IUnitTestElement parentElement,
ISolution solution,
BehaviorSpecificationFactory factory)
{
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 factory.GetOrCreateBehaviorSpecification(behavior,
new ClrTypeName(typeName),
methodName,
isIgnored);
}
示例3: DeserializeElement
public IUnitTestElement DeserializeElement(XmlElement parent, IUnitTestElement parentElement)
{
var typeName = parent.GetAttribute("elementType");
if (Equals(typeName, "ContextElement"))
{
return ContextElement.ReadFromXml(parent,
_solution,
_contextFactory);
}
if (Equals(typeName, "BehaviorElement"))
{
return BehaviorElement.ReadFromXml(parent,
parentElement,
_solution,
_behaviorFactory);
}
if (Equals(typeName, "BehaviorSpecificationElement"))
{
return BehaviorSpecificationElement.ReadFromXml(parent,
parentElement,
_solution,
_behaviorSpecificationFactory);
}
if (Equals(typeName, "ContextSpecificationElement"))
{
return ContextSpecificationElement.ReadFromXml(parent,
parentElement,
_solution,
_contextSpecificationFactory);
}
return null;
}
示例4: Equals
public bool Equals(IUnitTestElement other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
if (!(other is SilverlightUnitTestElement)) return false;
return Equals(other.Id, Id);
}
示例5: GallioTestElementBase
protected GallioTestElementBase(IUnitTestRunnerProvider provider, string id, IUnitTestElement parent)
{
Provider = provider;
Id = id;
Parent = parent;
children = new List<IUnitTestElement>();
}
示例6: 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);
}
示例7: Present
public void Present(IUnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state)
{
if (element is Element)
{
this._presenter.UpdateItem(element, node, item, state);
}
}
示例8: 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);
}
示例9: SerializeElement
public void SerializeElement(XmlElement parent, IUnitTestElement element)
{
parent.SetAttribute("type", element.GetType().Name);
var writableUnitTestElement = (ISerializableUnitTestElement)element;
writableUnitTestElement.WriteToXml(parent);
}
示例10: AssertTestMethod
private static XunitTestMethodElement AssertTestMethod(IUnitTestElement unitTestElement, string shortName)
{
Assert.IsInstanceOf<XunitTestMethodElement>(unitTestElement);
Assert.AreEqual(shortName, unitTestElement.ShortName);
Assert.AreEqual(UnitTestElementState.Valid, unitTestElement.State);
return (XunitTestMethodElement) unitTestElement;
}
示例11: AssertTestClass
private static XunitTestClassElement AssertTestClass(IUnitTestElement unitTestElement, object shortName)
{
Assert.IsInstanceOf<XunitTestClassElement>(unitTestElement);
Assert.AreEqual(shortName, unitTestElement.ShortName);
Assert.AreEqual(UnitTestElementState.Valid, unitTestElement.State);
return (XunitTestClassElement) unitTestElement;
}
示例12: GetRuntimeEnvironment
public RuntimeEnvironment GetRuntimeEnvironment(
IUnitTestElement element,
RuntimeEnvironment projectRuntimeEnvironment,
TargetPlatform targetPlatform,
IUnitTestLaunch launch)
{
return new RuntimeEnvironment { PlatformType = PlatformType.x86, PlatformVersion = PlatformVersion.v4_0 };
}
示例13: SerializeElement
public void SerializeElement(XmlElement parent, IUnitTestElement element)
{
var e = element as ISerializableElement;
if (e != null)
{
e.WriteToXml(parent);
parent.SetAttribute("elementType", e.GetType().Name);
}
}
示例14: Present
public void Present(IUnitTestElement element, IPresentableItem item, TreeModelNode node, PresentationState state)
{
// We only want to customise how class elements are displayed. If the
// parent node isn't a namespace, and isn't the namespace of the class,
// display the class as namespace qualified
if (!(element is XunitTestClassElement))
return;
treePresenter.UpdateItem(element, node, item, state);
}
示例15: DeserializeElement
public IUnitTestElement DeserializeElement(XmlElement parent, IUnitTestElement parentElement)
{
if (SilverlightUnitTestElement.CanDeserialize(parent))
{
return SilverlightUnitTestElement.Deserialize(parent, this);
}
throw new ArgumentOutOfRangeException();
}