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

namespace QC.QSPRLogSchema;

[Serializable]
[XmlType(AnonymousType = true)]
public class TestLibrary : IEquatable<TestLibrary>
{
	[DebuggerBrowsable(DebuggerBrowsableState.Never)]
	private string nameField;

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

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

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

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

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

	public TestLibrary()
	{
		nameField = string.Empty;
		versionField = string.Empty;
	}

	public TestLibrary(string name = null, string version = null)
	{
		if (!string.IsNullOrEmpty(name))
		{
			nameField = name;
		}
		else
		{
			nameField = string.Empty;
		}
		if (!string.IsNullOrEmpty(version))
		{
			versionField = version;
		}
		else
		{
			versionField = string.Empty;
		}
	}

	public bool Equals(TestLibrary other)
	{
		if (Name == other.Name)
		{
			return Version == other.Version;
		}
		return false;
	}
}
