Esempio n. 1
0
 public void Equals_Other_ReturnsExpected(SymbolToken symbolToken, object other, bool expected)
 {
     Assert.Equal(expected, symbolToken.Equals(other));
     if (other is SymbolToken otherSymbolToken)
     {
         Assert.Equal(expected, symbolToken.Equals(otherSymbolToken));
         Assert.Equal(expected, symbolToken == otherSymbolToken);
         Assert.Equal(!expected, symbolToken != otherSymbolToken);
     }
 }
Esempio n. 2
0
        public void EqualsDiffTypeTest()
        {
            var token = new SymbolToken(Symbols.Comma);

            Assert.False(token.Equals(1));
            Assert.NotEqual((object)1, token);
        }
Esempio n. 3
0
        public void EqualsSameObjectTest()
        {
            var token = new SymbolToken(Symbols.Comma);

            Assert.True(token.Equals(token));
            Assert.Equal(token, token);
        }
Esempio n. 4
0
        public void EqualsNullTest()
        {
            var token = new SymbolToken(Symbols.Comma);

            Assert.False(token.Equals(null));
            Assert.NotEqual(null, token);
        }
Esempio n. 5
0
        public void EqualsDiffSymbolTest()
        {
            var token1 = new SymbolToken(Symbols.Comma);
            var token2 = new SymbolToken(Symbols.CloseBrace);

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