using System;
using System.Collections.Generic;

namespace QC.CTDS.DM.DataStructures.InputDataStructure;

public class TestRunInfo
{
	private string testName;

	private string extendedTestName;

	private long runId;

	private string uutId;

	private long unitTestRunIndex;

	private long unitTestInstance;

	private Dictionary<string, ParamInfo> paramsDict = new Dictionary<string, ParamInfo>(StringComparer.Ordinal);

	private UnitInformation unitInfo;

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

	public string ExtendedTestName
	{
		get
		{
			return extendedTestName;
		}
		set
		{
			extendedTestName = value;
		}
	}

	public long RunId
	{
		get
		{
			return runId;
		}
		set
		{
			runId = value;
		}
	}

	public string UUT_ID
	{
		get
		{
			return uutId;
		}
		set
		{
			uutId = value;
		}
	}

	public long UnitTestRunIndex
	{
		get
		{
			return unitTestRunIndex;
		}
		set
		{
			unitTestRunIndex = value;
		}
	}

	public long UnitTestInstance
	{
		get
		{
			return unitTestInstance;
		}
		set
		{
			unitTestInstance = value;
		}
	}

	public Dictionary<string, ParamInfo> ParamsDict
	{
		get
		{
			return paramsDict;
		}
		set
		{
			paramsDict = value;
		}
	}

	public UnitInformation UnitInfo
	{
		get
		{
			return unitInfo;
		}
		set
		{
			unitInfo = value;
		}
	}

	public bool ContainsParam(string paramName)
	{
		if (paramsDict.ContainsKey(paramName))
		{
			return true;
		}
		if (unitInfo != null && unitInfo.UnitDataItemsDict.ContainsKey(paramName))
		{
			return true;
		}
		return false;
	}

	public ParamInfo GetParamValue(string paramName)
	{
		if (paramsDict.ContainsKey(paramName))
		{
			return paramsDict[paramName];
		}
		if (unitInfo != null && unitInfo.UnitDataItemsDict.ContainsKey(paramName))
		{
			ParamInfo paramInfo = new ParamInfo();
			paramInfo.StrVal = unitInfo.UnitDataItemsDict[paramName];
			return paramInfo;
		}
		return null;
	}

	public bool HasParamFailed(string paramName)
	{
		if (ContainsParam(paramName))
		{
			return GetParamValue(paramName).HasParamFailed();
		}
		return false;
	}
}
