コード例 #1
0
ファイル: TestCompilerServices.cs プロジェクト: ForNeVeR/pnet
    // Test that "RuntimeHelpers.GetHashCode" bypasses virtual overrides
    // on "Object.GetHashCode()" to perform the base class hash directly.
    public void TestHelpersGetHashCode()
    {
        GetHashCodeTest gh = new GetHashCodeTest();

        AssertEquals("GetHashCode (1)",
                     RuntimeHelpers.GetHashCode(gh),
                     gh.GetHashCode() - 1);

        AssertEquals("GetHashCode (2)", 0,
                     RuntimeHelpers.GetHashCode(null));
    }
コード例 #2
0
	// Test that "RuntimeHelpers.GetHashCode" bypasses virtual overrides
	// on "Object.GetHashCode()" to perform the base class hash directly.
	public void TestHelpersGetHashCode()
			{
				GetHashCodeTest gh = new GetHashCodeTest();
				AssertEquals("GetHashCode (1)",
							 RuntimeHelpers.GetHashCode(gh),
							 gh.GetHashCode() - 1);

				AssertEquals("GetHashCode (2)", 0,
							 RuntimeHelpers.GetHashCode(null));
			}