예제 #1
0
    public bool NegTest3()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("NegTest3: The Idictionary is readonly");

        try
        {
            IDictionary subHash = new SubHash();
            string      key     = "key";
            int         value   = TestLibrary.Generator.GetInt32(-55);
            subHash.Add(key, value);
            TestLibrary.TestFramework.LogError("105", "The NotSupportedException was not thrown as expected");
            retVal = false;
        }
        catch (NotSupportedException)
        {
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("106", "Unexpected exception: " + e);
            TestLibrary.TestFramework.LogInformation(e.StackTrace);
            retVal = false;
        }

        return(retVal);
    }
예제 #2
0
    public bool NegTest3()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("NegTest3: The Idictionary is readonly");

        try
        {
            IDictionary subHash = new SubHash();
            string key = "key";
            int value = TestLibrary.Generator.GetInt32(-55);
            subHash.Add(key, value);
            TestLibrary.TestFramework.LogError("105", "The NotSupportedException was not thrown as expected");
            retVal = false;
        }
        catch (NotSupportedException)
        {
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("106", "Unexpected exception: " + e);
            TestLibrary.TestFramework.LogInformation(e.StackTrace);
            retVal = false;
        }

        return retVal;
    }