using System.Collections.Generic;
using System.Runtime.InteropServices;
using QC.QsprTestObjects.Parameters;

namespace QC.QSPRSchedulerWrapper;

[ProgId("QSPR.TestInfo")]
[ClassInterface(ClassInterfaceType.None)]
[ComVisible(true)]
public class TestInfo : ITestInfo
{
	private string testName;

	private string realName;

	private string dllName;

	private string testIndex;

	private IParameterInfo[] parameters;

	public string TestName => testName;

	public string RealName => realName;

	public string DLLName => dllName;

	public string TestIndex => testIndex;

	public IParameterInfo[] Parameters => parameters;

	public TestInfo(string testName, string realName, string dllName, string testIndex, ParameterCollection parameters)
	{
		this.testName = testName;
		this.realName = realName;
		this.dllName = dllName;
		this.testIndex = testIndex;
		this.parameters = GetParameterInfoArray(parameters);
	}

	public TestInfo(string testName, string realName, string dllName, string testIndex, IParameterInfo[] parameters)
	{
		this.testName = testName;
		this.realName = realName;
		this.dllName = dllName;
		this.testIndex = testIndex;
		this.parameters = parameters;
	}

	private IParameterInfo[] GetParameterInfoArray(ParameterCollection parameters)
	{
		List<IParameterInfo> list = new List<IParameterInfo>();
		foreach (ParameterCls parameter in parameters)
		{
			list.Add(new ParameterInfo(parameter));
		}
		return list.ToArray();
	}
}
