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

        TestLibrary.TestFramework.BeginScenario("PosTest4: Check the int16 in the beginning of which there are some zeros ");

        try
        {
            Int16 i1 = -00000000000765;
            if (i1.ToString() != GlobLocHelper.OSInt16ToString(i1))
            {
                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);
    }
Beispiel #2
0
    public bool PosTest5()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest5: Convert a random int16 to string");

        try
        {
            Int16 i1 = TestLibrary.Generator.GetInt16(-55);
            if (i1.ToString() != GlobLocHelper.OSInt16ToString(i1))
            {
                TestLibrary.TestFramework.LogError("009", "The result is not the value as expected.The int16 is: " + i1.ToString());
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("010", "Unexpected exception: " + e);
            retVal = false;
        }

        return(retVal);
    }
Beispiel #3
0
    public bool PosTest3()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest3: Convert the \"-0\" to String ");

        try
        {
            Int16 i1 = -0;
            if (i1.ToString() != GlobLocHelper.OSInt16ToString(i1))
            {
                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);
    }
    public bool PosTest2()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest2: Convert the int16MinValue to String ");

        try
        {
            Int16  i1 = Int16.MinValue;
            string s1 = i1.ToString(new CultureInfo("en-ZA"));
            if (s1 != GlobLocHelper.OSInt16ToString(i1, new CultureInfo("en-ZA")))
            {
                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);
    }