public void EmptyObjectsAreEqual() { BasicObject newobj = new BasicObject(); Assert.IsTrue(newobj.Equals(this.obj)); Assert.IsTrue(this.obj.Equals(newobj)); Assert.AreEqual(this.obj.GetHashCode(), newobj.GetHashCode()); }
public void ObjectsWithSameNamesValuesAreEqual() { this.obj["Name"] = "Adam"; this.obj["Age"] = 800; BasicObject newobj = new BasicObject(); newobj["Age"] = 800; newobj["Name"] = "Adam"; Assert.IsTrue(newobj.Equals(this.obj)); Assert.IsTrue(this.obj.Equals(newobj)); Assert.AreEqual(this.obj.GetHashCode(), newobj.GetHashCode()); }
public void MakeDeepCopyOfSimpleObject() { this.obj["Name"] = "Adam"; this.obj["Age"] = 800; BasicObject newobj = this.obj.MakeDeepCopy(); Assert.IsTrue(newobj.Equals(this.obj)); ICollection <string> names = newobj.Names; Assert.IsNotNull(names); Assert.AreEqual(2, names.Count); Assert.AreEqual("Name", names.First()); Assert.AreEqual("Age", names.Skip(1).First()); }