public void EqualsTest() { CategoryItem target = new CategoryItem("Hello", CategoryItemType.String); object obj = null; bool actual = target.Equals(obj); Assert.AreEqual(false, actual); }
public void CategoryItemEquality() { CategoryItem a = new CategoryItem("Hello", CategoryItemType.String); CategoryItem b = new CategoryItem("Hello", CategoryItemType.String); Assert.IsTrue(a == b, "Equality operator failed"); Assert.AreEqual(true, a.Equals(b), "Explicit call to IEquatable<T> method failed"); Assert.AreEqual(a, b, "Generic Assert.AreEqual call failed"); }
public void EqualsTest1() { CategoryItem target = new CategoryItem("Hello", CategoryItemType.String); object obj = new CategoryItem("Hello", CategoryItemType.String); bool expected = true; bool actual; actual = target.Equals(obj); Assert.AreEqual(expected, actual); }