本文整理汇总了C#中Token.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# Token.GetHashCode方法的具体用法?C# Token.GetHashCode怎么用?C# Token.GetHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Token
的用法示例。
在下文中一共展示了Token.GetHashCode方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetHashCode
public new void GetHashCode()
{
Token testSubject = new Token(Token.ValueFor.ACTION, SqlTokenType.Null);
Assert.AreEqual(new Token(Token.ValueFor.ACTION,
SqlTokenType.Null).GetHashCode(),testSubject.GetHashCode());
}
示例2: TokensThatAreDifferent
public void TokensThatAreDifferent()
{
var token = new Token(new Substring(" Hello ", 1, 5));
var token2 = new Token(new Substring("\"Hello\"", 1, 5), true, true);
token.Equals(token2).Should().BeFalse();
token.Equals((object)token2).Should().BeFalse();
(token == token2).Should().BeFalse();
(token != token2).Should().BeTrue();
token.GetHashCode().Should().NotBe(token2.GetHashCode());
}
示例3: TokensThatAreEqual
public void TokensThatAreEqual()
{
var token = new Token(new Substring("Hello", 0, 2));
var token2 = token;
token.Equals(token2).Should().BeTrue();
token.Equals((object)token2).Should().BeTrue();
(token == token2).Should().BeTrue();
(token != token2).Should().BeFalse();
token.GetHashCode().Should().Be(token2.GetHashCode());
}
示例4: GetHashcode
public void GetHashcode()
{
var sut = new Token(TokenType.FieldnameWithTypeAndReference, null, null, null, null);
Assert.AreEqual(-1280274074, sut.GetHashCode());
}
示例5: op_GetHashCode
public void op_GetHashCode()
{
var obj = new Token("Example");
var expected = obj.ToString().GetHashCode();
var actual = obj.GetHashCode();
Assert.Equal(expected, actual);
}
示例6: TokenTests_Equals_GetHashCode_ShouldReturnDifferentCodeForDifferentData
public void TokenTests_Equals_GetHashCode_ShouldReturnDifferentCodeForDifferentData()
{
// Arrange
var lhs = new Token(TokenType.Number, "1", 0);
var rhs = new Token(TokenType.Number, "2", 0);
// Act
var result1 = lhs.GetHashCode();
var result2 = rhs.GetHashCode();
// Assert
Assert.AreNotEqual(result1, result2);
}
示例7: TokenTests_Equals_GetHashCode_ShouldReturnSameCodeForSameValues
public void TokenTests_Equals_GetHashCode_ShouldReturnSameCodeForSameValues()
{
// Arrange
var lhs = new Token(TokenType.Number, "1", 0);
var rhs = new Token(TokenType.Number, "1", 0);
// Act
var result1 = lhs.GetHashCode();
var result2 = rhs.GetHashCode();
// Assert
Assert.AreEqual(result1, result2);
}
示例8: TokenGethashCodeTest
public void TokenGethashCodeTest()
{
String value = "test";
target = new Token(TokenType.StringLiteral, value);
Assert.AreEqual(value.GetHashCode(), target.GetHashCode());
}