Example #1
0
    public bool PosTest4()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest4: Convert a random uint64 to string value");

        try
        {
            UInt64 u64  = (UInt64)this.GetInt32(0, UInt32.MaxValue);
            string str  = u64.ToString();
            string str2 = GlobLocHelper.OSUInt64ToString(u64);
            if (str != str2)
            {
                TestLibrary.TestFramework.LogError("007", "The result is not the value as expected");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("008", "Unexpected exception: " + e);
            retVal = false;
        }

        return(retVal);
    }
Example #2
0
    public bool PosTest3()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest3: A UInt64 number begin with zeros");

        try
        {
            UInt64 u64 = 00009876;
            string str = u64.ToString();
            if (str != GlobLocHelper.OSUInt64ToString(u64))
            {
                TestLibrary.TestFramework.LogError("005", "The result is not the value as expected");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("006", "Unexpected exception: " + e);
            retVal = false;
        }

        return(retVal);
    }
Example #3
0
    public bool PosTest2()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest2: Convert UInt64MinValue to string value");

        try
        {
            UInt64 u64 = UInt64.MinValue;
            string str = u64.ToString();
            if (str != GlobLocHelper.OSUInt64ToString(u64))
            {
                TestLibrary.TestFramework.LogError("003", "The result is not the value as expected");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("004", "Unexpected exception: " + e);
            retVal = false;
        }

        return(retVal);
    }