コード例 #1
0
ファイル: idictionaryclear.cs プロジェクト: yukitos/coreclr
    public bool NegTest1()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("NegTest1: The IDictionary is read-only");

        try
        {
            IDictionary iDictionary = new MyIDictionary();
            iDictionary.Clear();
            TestLibrary.TestFramework.LogError("101", "The NotSupportedException was not thrown as expected");
            retVal = false;
        }
        catch (NotSupportedException)
        {
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("102", "Unexpected exception: " + e);
            TestLibrary.TestFramework.LogInformation(e.StackTrace);
            retVal = false;
        }

        return(retVal);
    }
コード例 #2
0
    public bool NegTest1()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("NegTest1: The IDictionary is read-only");

        try
        {
            IDictionary iDictionary = new MyIDictionary();
            iDictionary.Clear();
            TestLibrary.TestFramework.LogError("101", "The NotSupportedException was not thrown as expected");
            retVal = false;
        }
        catch (NotSupportedException)
        {
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("102", "Unexpected exception: " + e);
            TestLibrary.TestFramework.LogInformation(e.StackTrace);
            retVal = false;
        }

        return retVal;
    }