using System;
using System.Xml;

namespace QC.CompareTestTree;

public class ReportStats
{
	private string testType;

	private string testName;

	private int addCount;

	private int matchCount;

	private int removeCount;

	private int changeCount;

	private int totalCount;

	public string TestType
	{
		get
		{
			return testType;
		}
		set
		{
			testType = value;
		}
	}

	public string TestName
	{
		get
		{
			return testName;
		}
		set
		{
			testName = value;
		}
	}

	public int AddCount
	{
		get
		{
			return addCount;
		}
		set
		{
			addCount = value;
		}
	}

	public int MatchCount
	{
		get
		{
			return matchCount;
		}
		set
		{
			matchCount = value;
		}
	}

	public int RemoveCount
	{
		get
		{
			return removeCount;
		}
		set
		{
			removeCount = value;
		}
	}

	public int ChangeCount
	{
		get
		{
			return changeCount;
		}
		set
		{
			changeCount = value;
		}
	}

	public int TotalCount
	{
		get
		{
			return totalCount;
		}
		set
		{
			totalCount = value;
		}
	}

	public void DetermineStatics(XmlNode parentNode)
	{
		if (parentNode.HasChildNodes)
		{
			XmlNodeList childNodes = parentNode.ChildNodes;
			for (int i = 0; i < childNodes.Count; i++)
			{
				DetermineStatics(childNodes[i]);
			}
		}
		try
		{
			if (parentNode.Attributes["delta"] != null)
			{
				TotalCount++;
				switch (parentNode.Attributes["delta"].Value)
				{
				case "Add":
					AddCount++;
					break;
				case "Change":
					ChangeCount++;
					break;
				case "Match":
					MatchCount++;
					break;
				case "Remove":
					RemoveCount++;
					break;
				}
			}
		}
		catch (Exception ex)
		{
			throw new Exception(ex.Message, ex);
		}
	}
}
