Equals() public method

Determines whether the specified System.Object, is equal to this instance.
public Equals ( object obj ) : bool
obj object The to compare with this instance.
return bool
示例#1
0
 public void TestEquality_Null()
 {
     var rs = new ResultState(TestStatus.Passed);
     Assert.AreNotEqual(null, rs);
     Assert.AreNotEqual(rs, null);
     Assert.False(rs.Equals(null));
 }
示例#2
0
        public void TestEquality_WrongType()
        {
            var rs = new ResultState(TestStatus.Passed);
            var s = "123";

            Assert.AreNotEqual(rs, s);
            Assert.AreNotEqual(s, rs);
            Assert.False(rs.Equals(s));
        }