public virtual bool runTest() { Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver " + s_strDtTmVer); int iCountErrors = 0; int iCountTestcases = 0; String strLoc = "Loc_000oo"; String strBaseLoc = ""; try { LABEL_860_GENERAL: do { StreamingContext sCon1, sCon2; int iState; String str1; sCon1 = new StreamingContext(StreamingContextStates.CrossMachine); sCon2 = new StreamingContext(StreamingContextStates.CrossMachine); iCountTestcases++; if (sCon1.GetHashCode() != sCon2.GetHashCode()) { iCountErrors++; printerr("Error_100aa! Two different objects should not return the same hashcode"); } sCon1 = new StreamingContext(StreamingContextStates.CrossMachine); sCon2 = new StreamingContext(StreamingContextStates.CrossProcess); iCountTestcases++; if (sCon1.GetHashCode() == sCon2.GetHashCode()) { iCountErrors++; printerr("Error_100aa! Two different objects should not return the same hashcode"); } } while (false); } catch (Exception exc_general) { ++iCountErrors; Console.WriteLine(s_strTFAbbrev + " : Error Err_8888yyy! strLoc==" + strLoc + ", exc_general==\n" + exc_general.StackTrace); } if (iCountErrors == 0) { Console.WriteLine("paSs. " + s_strTFPath + " " + s_strTFName + " ,iCountTestcases==" + iCountTestcases); return(true); } else { Console.WriteLine("FAiL! " + s_strTFPath + " " + s_strTFName + " ,iCountErrors==" + iCountErrors + " , BugNums?: " + s_strActiveBugNums); return(false); } }
public virtual bool runTest() { Console.WriteLine(s_strTFPath + " " + s_strTFName + " , for " + s_strClassMethod + " , Source ver " + s_strDtTmVer); int iCountErrors = 0; int iCountTestcases = 0; String strLoc = "Loc_000oo"; String strBaseLoc = ""; try { LABEL_860_GENERAL: do { StreamingContext sCon1, sCon2; int iState; String str1; sCon1 = new StreamingContext(StreamingContextStates.CrossMachine); sCon2 = new StreamingContext(StreamingContextStates.CrossMachine); iCountTestcases++; if(sCon1.GetHashCode() != sCon2.GetHashCode()) { iCountErrors++; printerr("Error_100aa! Two different objects should not return the same hashcode"); } sCon1 = new StreamingContext(StreamingContextStates.CrossMachine); sCon2 = new StreamingContext(StreamingContextStates.CrossProcess); iCountTestcases++; if(sCon1.GetHashCode() == sCon2.GetHashCode()) { iCountErrors++; printerr("Error_100aa! Two different objects should not return the same hashcode"); } } while (false); } catch (Exception exc_general ) { ++iCountErrors; Console.WriteLine (s_strTFAbbrev + " : Error Err_8888yyy! strLoc=="+ strLoc +", exc_general==\n"+exc_general.StackTrace); } if ( iCountErrors == 0 ) { Console.WriteLine( "paSs. "+s_strTFPath +" "+s_strTFName+" ,iCountTestcases=="+iCountTestcases); return true; } else { Console.WriteLine("FAiL! "+s_strTFPath+" "+s_strTFName+" ,iCountErrors=="+iCountErrors+" , BugNums?: "+s_strActiveBugNums ); return false; } }
public void GetHashCode_Invoke_ReturnsState() { var context = new StreamingContext((StreamingContextStates)10); Assert.Equal(10, context.GetHashCode()); }