using System;
using System.Diagnostics;
using System.Xml.Serialization;

namespace QC.QSPRLogSchema;

[Serializable]
[XmlType(AnonymousType = true)]
public class TestCase
{
	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string testSpecField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string versionField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string nameField;

	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string tcCaseIDField;

	[XmlAttribute]
	public long DisplayID { get; set; }

	[XmlAttribute("TestSpec")]
	public string TestSpecification
	{
		get
		{
			return testSpecField;
		}
		set
		{
			testSpecField = value;
		}
	}

	[XmlAttribute]
	public string Version
	{
		get
		{
			return versionField;
		}
		set
		{
			versionField = value;
		}
	}

	[XmlAttribute]
	public string Name
	{
		get
		{
			return nameField;
		}
		set
		{
			nameField = value;
		}
	}

	[XmlAttribute]
	public string TCCaseID
	{
		get
		{
			return tcCaseIDField;
		}
		set
		{
			tcCaseIDField = value;
		}
	}

	public bool ShouldSerializeTestSpecification()
	{
		return !string.IsNullOrEmpty(TestSpecification);
	}

	public bool ShouldSerializeVersion()
	{
		return !string.IsNullOrEmpty(Version);
	}

	public bool ShouldSerializeName()
	{
		return !string.IsNullOrEmpty(Name);
	}

	public bool ShouldSerializeTCCaseID()
	{
		return !string.IsNullOrEmpty(TCCaseID);
	}

	public TestCase()
	{
		testSpecField = string.Empty;
		versionField = string.Empty;
		nameField = string.Empty;
		tcCaseIDField = string.Empty;
	}

	public TestCase(string testSpec = null, string version = null, string name = null, string tcCaseID = null, long? displayId = null)
	{
		if (!string.IsNullOrEmpty(testSpec))
		{
			testSpecField = testSpec;
		}
		else
		{
			testSpecField = string.Empty;
		}
		if (!string.IsNullOrEmpty(version))
		{
			versionField = version;
		}
		else
		{
			versionField = string.Empty;
		}
		if (!string.IsNullOrEmpty(name))
		{
			nameField = name;
		}
		else
		{
			nameField = string.Empty;
		}
		if (!string.IsNullOrEmpty(tcCaseID))
		{
			tcCaseIDField = tcCaseID;
		}
		else
		{
			tcCaseIDField = string.Empty;
		}
		if (displayId.HasValue)
		{
			DisplayID = displayId.Value;
		}
	}
}
