public void TestGnipUrlDeserialize_01() { GnipUrl gnipUrl = new GnipUrl( "url 1", "metaUrl 1"); string str = XmlHelper.Instance.ToXmlString<GnipUrl>(gnipUrl); GnipUrl des = XmlHelper.Instance.FromXmlString<GnipUrl>(str); Assert.IsTrue(gnipUrl.DeepEquals(des)); }
public void TestGnipUrlConstructor_01() { GnipUrl gnipUrl = new GnipUrl(); gnipUrl.MetaUrl = "metaUrl 1"; gnipUrl.Url = "url 1"; GnipUrl gnipUrl2 = new GnipUrl( "url 1", "metaUrl 1"); Assert.IsTrue(gnipUrl.DeepEquals(gnipUrl2)); }
public void TestGnipUrlSerialize_01() { GnipUrl gnipUrl = new GnipUrl( "url 1", "metaUrl 1"); string str = XmlHelper.Instance.ToXmlString<GnipUrl>(gnipUrl); Assert.AreEqual("<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<gnipURL xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" metaURL=\"metaUrl 1\">url 1</gnipURL>", str); }
private void TestDeepEquals(GnipUrl objectA, GnipUrl objectB, bool expect, bool expectDeep) { Assert.AreEqual(expectDeep, objectA.DeepEquals(objectB)); Assert.AreEqual(expectDeep, objectB.DeepEquals(objectA)); Assert.AreEqual(expect, objectA.Equals(objectB)); Assert.AreEqual(expect, objectB.Equals(objectA)); }
/// <summary> /// Determins if this equals that by performing a deep equals /// looking at all elements of all member listsand objects. /// </summary> /// <param name="that">The object to compare for equality.</param> /// <returns>True if this is equal to that, false otherwise.</returns> public bool DeepEquals(GnipUrl that) { if (this == that) return true; else if (that == null) return false; return (string.Equals(this.MetaUrl, that.MetaUrl) && string.Equals(this.Url, that.Url)); }