public ProgressEventArgs (CoverageItem item, string fileName, int pos, int itemCount) { this.item = item; this.fileName = fileName; this.pos = pos; this.itemCount = itemCount; }
public void AddChildren(CoverageItem item) { if (children == null) children = new ArrayList (); children.Add (item); item.parent = this; }
public CoverageItem(CoverageItem parent) : this() { if (parent != null) { parent.AddChildren(this); } }
public ProgressEventArgs(CoverageItem item, string fileName, int pos, int itemCount) { this.item = item; this.fileName = fileName; this.pos = pos; this.itemCount = itemCount; }
public void AddChildren(CoverageItem item) { if (children == null) { children = new ArrayList(); } children.Add(item); item.parent = this; }
private void WriteCoverage(CoverageItem item) { double coverage; if (item.hit + item.missed == 0) { coverage = 1.0; } else { coverage = (double)item.hit / (item.hit + item.missed); } string coveragePercent = String.Format("{0:###0}", coverage * 100); writer.WriteStartElement("coverage"); writer.WriteAttributeString("hit", item.hit.ToString()); writer.WriteAttributeString("missed", item.missed.ToString()); writer.WriteAttributeString("coverage", coveragePercent); writer.WriteEndElement(); }
public CoverageItem(CoverageItem parent) : this() { if (parent != null) parent.AddChildren (this); }
public NamespaceCoverageItem(CoverageItem parent, string ns) : base(parent) { this.ns = ns; }
private void WriteCoverage (CoverageItem item) { double coverage; if (item.hit + item.missed == 0) coverage = 1.0; else coverage = (double)item.hit / (item.hit + item.missed); string coveragePercent = String.Format ("{0:###0}", coverage * 100); writer.WriteStartElement ("coverage"); writer.WriteAttributeString ("hit", item.hit.ToString ()); writer.WriteAttributeString ("missed", item.missed.ToString ()); writer.WriteAttributeString ("coverage", coveragePercent); writer.WriteEndElement (); }
private void WriteItem(CoverageItem item, Type stopLevel, int level) { if (item.filtered) return; if (item.hit + item.missed == 0) // Filtered return; if (level == 0) return; if (item.GetType () == stopLevel) return; if (item is CoverageModel) { writer.WriteStartElement ("project"); writer.WriteAttributeString ("name", "Project"); } else if (item is NamespaceCoverageItem) { NamespaceCoverageItem ns = (NamespaceCoverageItem)item; writer.WriteStartElement ("namespace"); if (ns.ns == "<GLOBAL>") writer.WriteAttributeString ("name", "GLOBAL"); else writer.WriteAttributeString ("name", ns.ns); } else if (item is ClassCoverageItem) { ClassCoverageItem klass = (ClassCoverageItem)item; writer.WriteStartElement ("class"); writer.WriteAttributeString ("name", klass.name); writer.WriteAttributeString ("fullname", klass.FullName.Replace ('/', '.')); } WriteCoverage (item); if (item.ChildCount > 0) foreach (CoverageItem child in item.children) WriteItem (child, stopLevel, level - 1); writer.WriteEndElement (); }
private void WriteItem(CoverageItem item, Type stopLevel, int level) { if (item.filtered) { return; } if (item.hit + item.missed == 0) { // Filtered return; } if (level == 0) { return; } if (item.GetType() == stopLevel) { return; } if (item is CoverageModel) { writer.WriteStartElement("project"); writer.WriteAttributeString("name", "Project"); } else if (item is NamespaceCoverageItem) { NamespaceCoverageItem ns = (NamespaceCoverageItem)item; writer.WriteStartElement("namespace"); if (ns.ns == "<GLOBAL>") { writer.WriteAttributeString("name", "GLOBAL"); } else { writer.WriteAttributeString("name", ns.ns); } } else if (item is ClassCoverageItem) { ClassCoverageItem klass = (ClassCoverageItem)item; writer.WriteStartElement("class"); writer.WriteAttributeString("name", klass.name); writer.WriteAttributeString("fullname", klass.FullName.Replace('/', '.')); } WriteCoverage(item); if (item.ChildCount > 0) { foreach (CoverageItem child in item.children) { WriteItem(child, stopLevel, level - 1); } } writer.WriteEndElement(); }
public ClassCoverageItem(CoverageItem parent) : base(parent) { methodsByMethod = new Hashtable(); }