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); }
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); }
public void SerializeElement(XmlElement parent, IUnitTestElement element) { parent.SetAttribute("type", element.GetType().Name); var writableUnitTestElement = (ISerializableUnitTestElement)element; writableUnitTestElement.WriteToXml(parent); }
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()); }
public void SerializeElement([NotNull] XmlElement xmlElement, [NotNull] IUnitTestElement element) { xmlElement.SetAttribute(c_elementType, element.GetType().FullName); xmlElement.SetAttribute(c_absoluteId, element.Id); xmlElement.SetAttribute(c_projectId, ObjectExtensions.NotNull(((ITestElement)element).GetProject()).GetPersistentID()); xmlElement.SetAttribute(c_text, element.GetPresentation()); xmlElement.SetAttribute(c_categories, element.Categories.Select(x => x.Name).Join("|")); }
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); }
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); }
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 "Fixie" id installed var writableUnitTestElement = element as ISerializableUnitTestElement; if (writableUnitTestElement != null) { writableUnitTestElement.WriteToXml(parent); } }
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); }
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)); }
public bool Equals(IUnitTestElement other) { if (ReferenceEquals(null, other)) { return(false); } 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) { Debug.Fail("Should not happen as the type name should be persisted!"); return(false); } return(Equals(other.Id, this.Id) && other.ShortName == this.ShortName && thisFullName == otherFullName); } return(false); }
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; }
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("|")); }
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; }
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); }