public bool NegTest4() { bool retVal = true; TestLibrary.TestFramework.BeginScenario("NegTest4: The Idictionary has a fixed size"); try { IDictionary subHash = new SubHash2(); string key = "key"; int value = TestLibrary.Generator.GetInt32(-55); subHash.Add(key, value); TestLibrary.TestFramework.LogError("107", "The NotSupportedException was not thrown as expected"); retVal = false; } catch (NotSupportedException) { } catch (Exception e) { TestLibrary.TestFramework.LogError("108", "Unexpected exception: " + e); TestLibrary.TestFramework.LogInformation(e.StackTrace); retVal = false; } return(retVal); }
public bool NegTest4() { bool retVal = true; TestLibrary.TestFramework.BeginScenario("NegTest4: The Idictionary has a fixed size"); try { IDictionary subHash = new SubHash2(); string key = "key"; int value = TestLibrary.Generator.GetInt32(-55); subHash.Add(key, value); TestLibrary.TestFramework.LogError("107", "The NotSupportedException was not thrown as expected"); retVal = false; } catch (NotSupportedException) { } catch (Exception e) { TestLibrary.TestFramework.LogError("108", "Unexpected exception: " + e); TestLibrary.TestFramework.LogInformation(e.StackTrace); retVal = false; } return retVal; }