Exemplo n.º 1
0
    public bool PosTest2()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest2: UInt32(minValue, 'F', en-US)");

        try
        {
            UInt32      uintA     = UInt32.MinValue;
            string      str       = "F";
            CultureInfo myculture = new CultureInfo("en-US");
            String      strA      = uintA.ToString(str, myculture);
            if (strA != GlobLocHelper.OSUInt32ToString(uintA, str, myculture))
            {
                TestLibrary.TestFramework.LogError("003", "Expected: " + GlobLocHelper.OSUInt32ToString(uintA, str, myculture) +
                                                   ", actual: " + strA);
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("004", "Unexpected exception: " + e);
            retVal = false;
        }
        return(retVal);
    }
Exemplo n.º 2
0
    public bool PosTest9()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest9: UInt32(MaxValue, 'N', sv-SE)");

        try
        {
            UInt32      uintA     = UInt32.MaxValue;
            string      str       = "N";
            CultureInfo myculture = new CultureInfo("sv-SE");
            String      strA      = uintA.ToString(str, myculture);
            if (strA != GlobLocHelper.OSUInt32ToString(uintA, str, myculture))
            {
                TestLibrary.TestFramework.LogError("017", "Expected: " + GlobLocHelper.OSUInt32ToString(uintA, str, myculture) +
                                                   ", actual: " + strA);
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("018", "Unexpected exception: " + e);
            retVal = false;
        }
        return(retVal);
    }
Exemplo n.º 3
0
    public bool PosTest2()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest2: UInt32 maxValue ToString 1");

        try
        {
            UInt32      uintA     = UInt32.MaxValue;
            CultureInfo myculture = new CultureInfo("en-us");
            String      strA      = uintA.ToString(myculture);
            if (strA != GlobLocHelper.OSUInt32ToString(uintA, new CultureInfo("en-US")))
            {
                TestLibrary.TestFramework.LogError("003", "the ActualResult is not the ExpectResult");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("004", "Unexpected exception: " + e);
            retVal = false;
        }
        return(retVal);
    }
Exemplo n.º 4
0
    public bool PosTest4()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest4: UInt32 maxValue ToString but provider is null");

        try
        {
            UInt32      uintA     = UInt32.MaxValue;
            CultureInfo myculture = null;
            String      strA      = uintA.ToString(myculture);
            if (strA != GlobLocHelper.OSUInt32ToString(uintA, (CultureInfo)null))
            {
                TestLibrary.TestFramework.LogError("007", "the ActualResult is not the ExpectResult");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("008", "Unexpected exception: " + e);
            retVal = false;
        }
        return(retVal);
    }
Exemplo n.º 5
0
    public bool PosTest3()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest3:Random UInt32 num ToString 1");

        try
        {
            UInt32 uintA = 2147483648;
            String strA  = uintA.ToString();
            if (strA != GlobLocHelper.OSUInt32ToString(uintA))
            {
                TestLibrary.TestFramework.LogError("005", "the ActualResult is not the ExpectResult");
                TestLibrary.TestFramework.LogInformation("Expected: " + GlobLocHelper.OSUInt32ToString(uintA) + "\nActual: " + strA);
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("006", "Unexpected exception: " + e);
            retVal = false;
        }
        return(retVal);
    }
Exemplo n.º 6
0
    public bool PosTest1()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest1: UInt32 minValue ToString");

        try
        {
            UInt32 uintA = UInt32.MinValue;
            String strA  = uintA.ToString();
            if (strA != GlobLocHelper.OSUInt32ToString(uintA))
            {
                TestLibrary.TestFramework.LogError("001", "the ActualResult is not the ExpectResult");
                TestLibrary.TestFramework.LogInformation("Expected: " + GlobLocHelper.OSUInt32ToString(uintA) + "\nActual: " + strA);
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("002", "Unexpected exception: " + e);
            retVal = false;
        }
        return(retVal);
    }