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

        TestLibrary.TestFramework.BeginScenario("PosTest1:The SByte MaxValue ToString 1");
        try
        {
            sbyte  SByteVal = sbyte.MaxValue;
            string format1  = null;
            string format2  = string.Empty;
            string desStr1  = SByteVal.ToString(format1);
            string desStr2  = SByteVal.ToString(format2);
            if (desStr1 != GlobLocHelper.OSSByteToString(SByteVal, format1) || desStr2 != GlobLocHelper.OSSByteToString(SByteVal, format2))
            {
                TestLibrary.TestFramework.LogError("001", "The ExpectResult is not the ActualResult");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("002", "Unexpect exception:" + e);
            retVal = false;
        }
        return(retVal);
    }
Example #2
0
    public bool PosTest3()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest3:The random SByte ToString 1");
        try
        {
            sbyte  SByteVal = 10;
            string desStr   = SByteVal.ToString();
            if (desStr != GlobLocHelper.OSSByteToString(SByteVal))
            {
                TestLibrary.TestFramework.LogError("005", "The ExpectResult is not the ActualResult");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("006", "Unexpect exception:" + e);
            retVal = false;
        }
        return(retVal);
    }
Example #3
0
    public bool PosTest5()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest5:The SByte MinValue ToString 2");
        try
        {
            sbyte  SByteVal = sbyte.MinValue;
            string format   = "D";
            string desStr   = SByteVal.ToString(format);
            if (desStr != GlobLocHelper.OSSByteToString(SByteVal, format))
            {
                TestLibrary.TestFramework.LogError("009", "The ExpectResult is not the ActualResult");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("010", "Unexpect exception:" + e);
            retVal = false;
        }
        return(retVal);
    }
Example #4
0
    public bool PosTest2()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest2:The SByte MaxValue ToString 2");
        try
        {
            sbyte           SByteVal = sbyte.MaxValue;
            IFormatProvider provider = null;
            string          desStr   = SByteVal.ToString(provider);
            if (desStr != GlobLocHelper.OSSByteToString(SByteVal, (CultureInfo)null))
            {
                TestLibrary.TestFramework.LogError("003", "The ExpectResult is not the ActualResult");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("004", "Unexpect exception:" + e);
            retVal = false;
        }
        return(retVal);
    }
Example #5
0
    public bool PosTest6()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest6:The random SByte ToString 1");
        try
        {
            sbyte           SByteVal = -99;
            IFormatProvider provider = new CultureInfo("en-us");
            string          desStr   = SByteVal.ToString(provider);
            if (desStr != GlobLocHelper.OSSByteToString(SByteVal, new CultureInfo("en-us")))
            {
                TestLibrary.TestFramework.LogError("011", "The ExpectResult is not the ActualResult");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("012", "Unexpect exception:" + e);
            retVal = false;
        }
        return(retVal);
    }