DeepEquals() public method

Determins if this equals that by performing a deep equals looking at all elements of all member listsand objects.
public DeepEquals ( MediaUrl that ) : bool
that MediaUrl The object to compare for equality.
return bool
Esempio n. 1
1
 private void TestDeepEquals(MediaUrl objectA, MediaUrl 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));
 }
Esempio n. 2
0
        public void TestMediaUrlConstructor_01()
        {
            MediaUrl mediaUrl = new MediaUrl();
            mediaUrl.Url = "url 1";

            MediaUrl mediaUrl2 = new MediaUrl(
                "url 1");

            Assert.IsTrue(mediaUrl.DeepEquals(mediaUrl2));

            mediaUrl = new MediaUrl();
            mediaUrl.Url = "url 1";
            mediaUrl.Width = "width 1";
            mediaUrl.Height = "height 1";
            mediaUrl.Duration = "duration 1";
            mediaUrl.MimeType = "mimeType 1";
            mediaUrl.Type = "type 1";

            mediaUrl2 = new MediaUrl("url 1", "width 1", "height 1", "duration 1", "mimeType 1", "type 1");

            Assert.IsTrue(mediaUrl.DeepEquals(mediaUrl2));
        }
Esempio n. 3
0
        public void TestMediaUrlDeserialize_01()
        {
            MediaUrl mediaUrl = new MediaUrl("url 1", "width 1", "height 1", "duration 1", "mimeType 1", "type 1");

            string str = XmlHelper.Instance.ToXmlString<MediaUrl>(mediaUrl);

            MediaUrl des = XmlHelper.Instance.FromXmlString<MediaUrl>(str);
            Assert.IsTrue(mediaUrl.DeepEquals(des));
        }