本文整理汇总了C#中IUnitTestElement.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IUnitTestElement.GetType方法的具体用法?C# IUnitTestElement.GetType怎么用?C# IUnitTestElement.GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IUnitTestElement
的用法示例。
在下文中一共展示了IUnitTestElement.GetType方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SerializeElement
public void SerializeElement(XmlElement parent, IUnitTestElement element)
{
parent.SetAttribute("type", element.GetType().Name);
var testElement = element as XunitTestElementBase;
if (testElement == null)
throw new ArgumentException(string.Format("Element {0} is not MSTest", element.GetType()), "element");
testElement.WriteToXml(parent);
}
示例2: SerializeElement
public void SerializeElement(XmlElement parent, IUnitTestElement element)
{
parent.SetAttribute("type", element.GetType().Name);
var writableUnitTestElement = (ISerializableUnitTestElement)element;
writableUnitTestElement.WriteToXml(parent);
}
示例3: SerializeElement
public void SerializeElement(XmlElement parent, IUnitTestElement element)
{
parent.SetAttribute(TypeAttribute, element.GetType().Name);
var specificationElement = element as JasmineSpecificationElement;
if (specificationElement != null)
{
specificationElement.WriteToXml(parent);
return;
}
if (!(element is JasmineSuiteElement))
{
throw new ArgumentException(string.Format("Element {0} is not Jasmine", element.GetType()));
}
((JasmineSuiteElement)element).WriteToXml(parent);
}
示例4: SerializeElement
public void SerializeElement(XmlElement parent, IUnitTestElement element)
{
parent.SetAttribute("type", element.GetType().Name);
// Make sure that the element is actually ours before trying to serialise it
// This can happen if there are two providers with the same "xunit" id installed
var writableUnitTestElement = element as ISerializableUnitTestElement;
if (writableUnitTestElement != null)
writableUnitTestElement.WriteToXml(parent);
}
示例5: Equals
public bool Equals(IUnitTestElement other)
{
if (ReferenceEquals(this, other))
{
return true;
}
if (other.GetType() == GetType())
{
var element = (Element) other;
return other.ShortName == ShortName
&& other.Provider == Provider
&& Equals(element._projectEnvoy, _projectEnvoy)
&& element._declaringTypeName == _declaringTypeName;
}
return false;
}
示例6: SerializeElement
public void SerializeElement(XmlElement xmlElement, IUnitTestElement element)
{
xmlElement.SetAttribute(c_elementType, element.GetType().FullName);
xmlElement.SetAttribute(c_absoluteId, element.Id);
xmlElement.SetAttribute(c_projectId, ((ITestElement) element).GetProject().AssertNotNull().GetPersistentID());
xmlElement.SetAttribute(c_text, element.GetPresentation());
xmlElement.SetAttribute(c_categories, element.Categories.Select(x => x.Name).Join("|"));
}
示例7: Equals
public bool Equals(IUnitTestElement other)
{
if (ReferenceEquals(this, other))
{
return true;
}
if (other.GetType() == this.GetType())
{
var element = (Element)other;
string thisFullName;
string otherFullName;
try
{
// This might throw for invalid elements.
thisFullName = this._declaringTypeName.FullName;
otherFullName = element._declaringTypeName.FullName;
}
catch (NullReferenceException)
{
return false;
}
return Equals(other.Id, this.Id)
&& other.ShortName == this.ShortName
&& Equals(element._projectEnvoy, this._projectEnvoy)
&& thisFullName == otherFullName;
}
return false;
}
示例8: Equals
public virtual bool Equals(IUnitTestElement other)
{
if (ReferenceEquals(null, other))
{
return false;
}
if (ReferenceEquals(this, other))
{
return true;
}
if (other.GetType() != GetType())
{
return false;
}
return Equals(ProjectFileEnvoy, ((Element)other).ProjectFileEnvoy) &&
string.Equals(ShortName, other.ShortName) &&
Equals(Parent, other.Parent);
}