예제 #1
0
		public ProgressEventArgs (CoverageItem item, string fileName, 
								  int pos, int itemCount) {
			this.item = item;
			this.fileName = fileName;
			this.pos = pos;
			this.itemCount = itemCount;
		}
예제 #2
0
 public void AddChildren(CoverageItem item)
 {
     if (children == null)
         children = new ArrayList ();
     children.Add (item);
     item.parent = this;
 }
예제 #3
0
 public CoverageItem(CoverageItem parent) : this()
 {
     if (parent != null)
     {
         parent.AddChildren(this);
     }
 }
예제 #4
0
 public ProgressEventArgs(CoverageItem item, string fileName,
                          int pos, int itemCount)
 {
     this.item      = item;
     this.fileName  = fileName;
     this.pos       = pos;
     this.itemCount = itemCount;
 }
예제 #5
0
 public void AddChildren(CoverageItem item)
 {
     if (children == null)
     {
         children = new ArrayList();
     }
     children.Add(item);
     item.parent = this;
 }
예제 #6
0
        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();
        }
예제 #7
0
 public CoverageItem(CoverageItem parent)
     : this()
 {
     if (parent != null)
         parent.AddChildren (this);
 }
예제 #8
0
 public NamespaceCoverageItem(CoverageItem parent, string ns)
     : base(parent)
 {
     this.ns = ns;
 }
예제 #9
0
	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 ();
	}
예제 #10
0
        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 ();
        }
예제 #11
0
 public NamespaceCoverageItem(CoverageItem parent, string ns) : base(parent)
 {
     this.ns = ns;
 }
예제 #12
0
        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();
        }
예제 #13
0
 public ClassCoverageItem(CoverageItem parent) : base(parent)
 {
     methodsByMethod = new Hashtable();
 }