DeepEquals() public méthode

Determins if this equals that by performing a deep equals looking at all elements of all member listsand objects.
public DeepEquals ( Place that ) : bool
that Place The object to compare for equality.
Résultat bool
Exemple #1
0
        public void TestPlaceConstructor_01()
        {
            DateTime now = DateTime.Now;

            Place place = new Place();
            place.Point = new double[] { 10.0, 20.0 };
            place.Elevation = 2342.0;
            place.Floor = 2212;
            place.FeatureTypeTag = "FeatureTypeTag";
            place.FeatureName = "FeatureName";
            place.RelationshipTag = "RelationshipTag";

            Assert.AreEqual(2, place.Point.Length);
            Assert.AreEqual(10.0, place.Point[0]);
            Assert.AreEqual(20.0, place.Point[1]);
            Assert.AreEqual(2342.0, place.Elevation);
            Assert.AreEqual(2212, place.Floor);
            Assert.AreEqual("FeatureTypeTag", place.FeatureTypeTag);
            Assert.AreEqual("FeatureName", place.FeatureName);
            Assert.AreEqual("RelationshipTag", place.RelationshipTag);

            Place place2 = new Place(new double[] { 10.0, 20.0 }, 2342.0, 2212, "FeatureTypeTag", "FeatureName", "RelationshipTag");

            Assert.AreEqual(2, place2.Point.Length);
            Assert.AreEqual(10.0, place2.Point[0]);
            Assert.AreEqual(20.0, place2.Point[1]);
            Assert.AreEqual(2342.0, place2.Elevation);
            Assert.AreEqual(2212, place2.Floor);
            Assert.AreEqual("FeatureTypeTag", place2.FeatureTypeTag);
            Assert.AreEqual("FeatureName", place2.FeatureName);
            Assert.AreEqual("RelationshipTag", place2.RelationshipTag);

            Assert.IsTrue(place.DeepEquals(place2));
        }
Exemple #2
0
 private void TestDeepEquals(Place objectA, Place 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));
 }
Exemple #3
0
        public void TestPlaceDeserialize_01()
        {
            Place place = new Place(new double[] { 10.0, 20.0 }, 2343.0, 2212, "FeatureTypeTag", "FeatureName", "RelationshipTag");

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