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); } }
public void EqualsDiffTypeTest() { var token = new SymbolToken(Symbols.Comma); Assert.False(token.Equals(1)); Assert.NotEqual((object)1, token); }
public void EqualsSameObjectTest() { var token = new SymbolToken(Symbols.Comma); Assert.True(token.Equals(token)); Assert.Equal(token, token); }
public void EqualsNullTest() { var token = new SymbolToken(Symbols.Comma); Assert.False(token.Equals(null)); Assert.NotEqual(null, token); }
public void EqualsDiffSymbolTest() { var token1 = new SymbolToken(Symbols.Comma); var token2 = new SymbolToken(Symbols.CloseBrace); Assert.False(token1.Equals(token2)); Assert.NotEqual(token1, token2); }