DeepEquals() public method

Determins if this equals that by performing a deep equals looking at all elements of all member listsand objects.
public DeepEquals ( Filter that ) : bool
that Filter The object to compare for equality.
return bool
Ejemplo n.º 1
0
        public void TestFilterConstructor_01()
        {
            DateTime now = DateTime.Now;

            Filter filter = new Filter();
            filter.IsFullData = true;
            filter.PostUrl = "PostUrl";
            filter.Name = "FilterName";
            filter.Rules.Add(new Rule(RuleType.Actor, "ActorOne"));

            Filter filter2 = new Filter(
                "FilterName",
                "PostUrl",
                true,
                new Rule(RuleType.Actor, "ActorOne"));

            Assert.IsTrue(filter.DeepEquals(filter2));
        }
Ejemplo n.º 2
0
 private void TestDeepEquals(Filter objectA, Filter 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));
 }
Ejemplo n.º 3
0
        public void TestFilterDeserialize_01()
        {
            Filter filter = new Filter(
                "FilterName",
                "PostUrl",
                true,
                new Rule(RuleType.Actor, "ActorOne"));

            string str = XmlHelper.Instance.ToXmlString<Filter>(filter);
            Filter des = XmlHelper.Instance.FromXmlString<Filter>(str);
            Assert.IsTrue(filter.DeepEquals(des));
        }