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

namespace QC.QSPRLogSchema;

[Serializable]
[XmlType(AnonymousType = true)]
public class TestStatus
{
	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private ErrorCode errorCodeField;

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

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

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

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

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

	public ErrorCode ErrorCode
	{
		get
		{
			return errorCodeField;
		}
		set
		{
			errorCodeField = value;
		}
	}

	public string Comments
	{
		get
		{
			return commentsField;
		}
		set
		{
			commentsField = value;
		}
	}

	public string LogFilePath
	{
		get
		{
			return logFilePathField;
		}
		set
		{
			logFilePathField = value;
		}
	}

	[XmlAttribute("S")]
	public string StatusValue
	{
		get
		{
			return sField;
		}
		set
		{
			sField = value;
		}
	}

	[XmlAttribute]
	public string SkipReason
	{
		get
		{
			return skipReasonField;
		}
		set
		{
			skipReasonField = value;
		}
	}

	public string Warning
	{
		get
		{
			return warningField;
		}
		set
		{
			warningField = value;
		}
	}

	public bool ShouldSerializeErrorCode()
	{
		if (ErrorCode != null)
		{
			if (!ErrorCode.ShouldSerializeError() && !ErrorCode.ShouldSerializeSubError())
			{
				return ErrorCode.ShouldSerializeDescription();
			}
			return true;
		}
		return false;
	}

	public bool ShouldSerializeComments()
	{
		return !string.IsNullOrEmpty(Comments);
	}

	public bool ShouldSerializeLogFilePath()
	{
		return !string.IsNullOrEmpty(LogFilePath);
	}

	public bool ShouldSerializeStatusValue()
	{
		return !string.IsNullOrEmpty(StatusValue);
	}

	public bool ShouldSerializeSkipReason()
	{
		return !string.IsNullOrEmpty(SkipReason);
	}

	public bool ShouldSerializeWarning()
	{
		return !string.IsNullOrEmpty(Warning);
	}

	public TestStatus()
	{
		errorCodeField = new ErrorCode();
		commentsField = string.Empty;
		logFilePathField = string.Empty;
		sField = string.Empty;
		skipReasonField = string.Empty;
		Warning = string.Empty;
	}

	public TestStatus(ErrorCode errorCode = null, string comments = null, string logFilePath = null, string s = null, string skipReason = null)
	{
		if (errorCode != null)
		{
			errorCodeField = errorCode;
		}
		else
		{
			errorCodeField = new ErrorCode();
		}
		if (!string.IsNullOrEmpty(comments))
		{
			commentsField = comments;
		}
		else
		{
			commentsField = string.Empty;
		}
		if (!string.IsNullOrEmpty(logFilePath))
		{
			logFilePathField = logFilePath;
		}
		else
		{
			logFilePathField = string.Empty;
		}
		if (!string.IsNullOrEmpty(s))
		{
			sField = s;
		}
		else
		{
			sField = string.Empty;
		}
		if (!string.IsNullOrEmpty(skipReason))
		{
			skipReasonField = skipReason;
		}
		else
		{
			skipReasonField = string.Empty;
		}
		Warning = string.Empty;
	}
}
