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

        const string c_TEST_ID   = "P002";
        const string c_TEST_DESC = "PosTest2: lowercase character";
        string       errorDesc;

        TestLibrary.TestFramework.BeginScenario(c_TEST_DESC);
        try
        {
            char ch           = 'a';
            char expectedChar = GlobLocHelper.OSToUpper(ch); // 'A';
            char actualChar   = char.ToUpper(ch);
            if (actualChar != expectedChar)
            {
                errorDesc  = string.Format("Uppercase of character \\u{0:x} is not the value ", (int)ch);
                errorDesc += string.Format("\\u{0:x} as expected: actual(\\u{1:x}", (int)expectedChar, (int)actualChar);
                TestLibrary.TestFramework.LogError("003" + " TestId-" + c_TEST_ID, errorDesc);
                retVal = false;
            }
        }
        catch (Exception e)
        {
            errorDesc = "Unexpected exception: " + e;
            TestLibrary.TestFramework.LogError("004" + " TestId-" + c_TEST_ID, errorDesc);
            retVal = false;
        }

        return(retVal);
    }