当前位置: 首页>>代码示例>>C#>>正文


C# Token.GetHashCode方法代码示例

本文整理汇总了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());
        }
开发者ID:plusql,项目名称:hsqldb-snapshot-20160112,代码行数:7,代码来源:TestToken.cs

示例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());
        }
开发者ID:reubeno,项目名称:NClap,代码行数:11,代码来源:TokenTests.cs

示例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());
        }
开发者ID:reubeno,项目名称:NClap,代码行数:11,代码来源:TokenTests.cs

示例4: GetHashcode

 public void GetHashcode()
 {
     var sut = new Token(TokenType.FieldnameWithTypeAndReference, null, null, null, null);
     Assert.AreEqual(-1280274074, sut.GetHashCode());
 }
开发者ID:JamesDunlop,项目名称:StatePrinter,代码行数:5,代码来源:TokenFilterTest.cs

示例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);
        }
开发者ID:KarlDirck,项目名称:cavity,代码行数:9,代码来源:Token.Facts.cs

示例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);
        }
开发者ID:tathamoddie,项目名称:RegexAnalyzer,代码行数:13,代码来源:TokenTests.cs

示例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);
        }
开发者ID:tathamoddie,项目名称:RegexAnalyzer,代码行数:13,代码来源:TokenTests.cs

示例8: TokenGethashCodeTest

        public void TokenGethashCodeTest()
        {
            String value = "test";

            target = new Token(TokenType.StringLiteral, value);

            Assert.AreEqual(value.GetHashCode(), target.GetHashCode());
        }
开发者ID:AdrianToman1,项目名称:StringTemplateEngine,代码行数:8,代码来源:TokenUnitTests.cs


注:本文中的Token.GetHashCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。