public void BasicEquality() { Csla.ApplicationContext.GlobalContext.Clear(); Root r1 = Root.NewRoot(); r1.Data = "abc"; Assert.AreEqual(true, r1.Equals(r1), "objects should be equal on instance compare"); Assert.AreEqual(true, Equals(r1, r1), "objects should be equal on static compare"); Csla.ApplicationContext.GlobalContext.Clear(); Root r2 = Root.NewRoot(); r2.Data = "xyz"; Assert.AreEqual(false, r1.Equals(r2), "objects should not be equal"); Assert.AreEqual(false, Equals(r1, r2), "objects should not be equal"); Assert.AreEqual(false, r1.Equals(null), "Objects should not be equal"); Assert.AreEqual(false, Equals(r1, null), "Objects should not be equal"); Assert.AreEqual(false, Equals(null, r2), "Objects should not be equal"); }
public void BasicEquality() { TestResults.Reinitialise(); Root r1 = NewRoot(); r1.Data = "abc"; Assert.AreEqual(true, r1.Equals(r1), "objects should be equal on instance compare"); Assert.AreEqual(true, Equals(r1, r1), "objects should be equal on static compare"); TestResults.Reinitialise(); Root r2 = NewRoot(); r2.Data = "xyz"; Assert.AreEqual(false, r1.Equals(r2), "objects should not be equal"); Assert.AreEqual(false, Equals(r1, r2), "objects should not be equal"); Assert.AreEqual(false, r1.Equals(null), "Objects should not be equal"); Assert.AreEqual(false, Equals(r1, null), "Objects should not be equal"); Assert.AreEqual(false, Equals(null, r2), "Objects should not be equal"); }
public void BasicEquality() { #pragma warning disable CS0618 // Type or member is obsolete Csla.ApplicationContext.GlobalContext.Clear(); #pragma warning restore CS0618 // Type or member is obsolete Root r1 = Root.NewRoot(); r1.Data = "abc"; Assert.AreEqual(true, r1.Equals(r1), "objects should be equal on instance compare"); Assert.AreEqual(true, Equals(r1, r1), "objects should be equal on static compare"); #pragma warning disable CS0618 // Type or member is obsolete Csla.ApplicationContext.GlobalContext.Clear(); #pragma warning restore CS0618 // Type or member is obsolete Root r2 = Root.NewRoot(); r2.Data = "xyz"; Assert.AreEqual(false, r1.Equals(r2), "objects should not be equal"); Assert.AreEqual(false, Equals(r1, r2), "objects should not be equal"); Assert.AreEqual(false, r1.Equals(null), "Objects should not be equal"); Assert.AreEqual(false, Equals(r1, null), "Objects should not be equal"); Assert.AreEqual(false, Equals(null, r2), "Objects should not be equal"); }