Skip to content

Delete test testing a weird delegate implementation detail #102647

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ public bool RunTests()
retVal = PosTest1() && retVal;
retVal = PosTest2() && retVal;
retVal = PosTest3() && retVal;
retVal = PosTest4() && retVal;
retVal = PosTest6() && retVal;
retVal = PosTest7() && retVal;
retVal = PosTest8() && retVal;
return retVal;
Expand Down Expand Up @@ -150,71 +148,6 @@ public bool PosTest3()
// Returns true if the expected result is right
// Returns false if the expected result is wrong
// the same delegate object is booldelegate
public bool PosTest4()
{
bool retVal = true;

TestLibrary.TestFramework.BeginScenario("PosTest4: Use the same type's different static method to create two delegate which delegate object is the same,their hashcode is equal ");

try
{
DelegateGetHashCode delctor = new DelegateGetHashCode();
booldelegate workDelegate1= new booldelegate(TestClass.Working_Bool);
booldelegate workDelegate = new booldelegate(TestClass.Completed_Bool);
if (workDelegate.GetHashCode() != workDelegate1.GetHashCode())
{
TestLibrary.TestFramework.LogError("007", "HashCode is not excepted ");
retVal = false;
}

workDelegate();
workDelegate1();

}
catch (Exception e)
{
TestLibrary.TestFramework.LogError("008", "Unexpected exception: " + e);
retVal = false;
}

return retVal;
}
// Returns true if the expected result is right
// Returns false if the expected result is wrong
// the same delegate object is booldelegate
public bool PosTest6()
{
bool retVal = true;

TestLibrary.TestFramework.BeginScenario("PosTest6: Use the different type's same static method to create two delegate ,which delegate object is the same,their hashcode is equal");

try
{
DelegateGetHashCode delctor = new DelegateGetHashCode();
booldelegate workDelegate = new booldelegate(TestClass.Completed_Bool);
booldelegate workDelegate1 = new booldelegate(TestClass1.Completed_Bool);

if (workDelegate.GetHashCode()!=workDelegate1.GetHashCode())
{
TestLibrary.TestFramework.LogError("011", "HashCode is not excepted");
retVal = false;
}

workDelegate();
workDelegate1();

}
catch (Exception e)
{
TestLibrary.TestFramework.LogError("012", "Unexpected exception: " + e);
retVal = false;
}

return retVal;
}
// Returns true if the expected result is right
// Returns false if the expected result is wrong
// the same delegate object is booldelegate
public bool PosTest7()
{
bool retVal = true;
Expand Down