public void Equals() { TextValue v1 = new TextValue("Hello World"); TextValue v2 = new TextValue("hELLO wORLD"); Assert.IsTrue(v1.Equals(v2)); Assert.IsFalse(v1.Equals(new TextValue("Hello Worl"))); }
public void EqualsTest() { TextValue target = new TextValue("Test"); object obj = "Test"; // string bool expected = false; // we expect them not to be equal because they are not the same type. // Implicit conversion from string to TextValue does not take effect here. // However, even if it did, that might be fine too... this test is just asserting the expected (but not required) behavior. bool actual; actual = target.Equals(obj); Assert.AreEqual(expected, actual); obj = new TextValue("Test"); expected = true; actual = target.Equals(obj); Assert.AreEqual(expected, actual); }
public void UnansEquals3() { TextValue uv1 = new TextValue(); TextValue uv2 = new TextValue(); uv1.Equals(uv2); }
public void UnansEquals2() { TextValue v = new TextValue("Hello World"); TextValue uv = new TextValue(); v.Equals(uv); }
public void UnansEquals1() { TextValue v = new TextValue("Hello World"); TextValue uv = new TextValue(); uv.Equals(v); }
public void EqualsTest1() { TextValue target = new TextValue("my value"); TextValue operand = new TextValue("my value"); bool expected = true; bool actual; actual = target.Equals(operand); Assert.AreEqual(expected, actual); operand = new TextValue("my other value"); expected = false; actual = target.Equals(operand); Assert.AreEqual(expected, actual); }