public void test_equality() { var a = new SampleId("a"); var b = new SampleId("a"); Assert.AreEqual(a, b); Assert.IsTrue(a.Equals(b)); Assert.IsTrue(a.Equals(a)); Assert.IsTrue(a == b); }
public void test_inequality() { var a = new SampleId("a"); var b = new SampleId("b"); Assert.AreNotEqual(a, null); Assert.AreNotEqual(a, b); Assert.IsFalse(a.Equals(b)); Assert.IsFalse(a.Equals(null)); Assert.IsFalse(a == b); }
public void different_classes_with_same_id_value_should_not_be_equal() { var a = new SampleId("a"); var b = new AnotherSampleId("a"); Assert.IsFalse(a.Equals(b)); }