Equals() public method

Determines whether the specified object is equal to the current object.
public Equals ( object obj ) : bool
obj object The object to compare with the current object.
return bool
Esempio n. 1
0
        public void EqualsSameObjectTest()
        {
            var token = new FunctionToken(Functions.Sine, 1);

            Assert.True(token.Equals(token));
            Assert.Equal(token, token);
        }
Esempio n. 2
0
        public void EqualsDiffTypeTest()
        {
            var token = new FunctionToken(Functions.Sine, 1);

            Assert.False(token.Equals(1));
            Assert.NotEqual((object)1, token);
        }
Esempio n. 3
0
        public void EqualsNullTest()
        {
            var token = new FunctionToken(Functions.Sine, 1);

            Assert.False(token.Equals(null));
            Assert.NotEqual(null, token);
        }
Esempio n. 4
0
        public void EqualsDiffFuncTest()
        {
            var token1 = new FunctionToken(Functions.Sine, 1);
            var token2 = new FunctionToken(Functions.Cosine, 1);

            Assert.False(token1.Equals(token2));
            Assert.NotEqual(token1, token2);
        }