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

        TestLibrary.TestFramework.BeginScenario("NegTest1: Set the format string argument as a invalid value ");

        try
        {
            e_test e2 = e_test.itemC;
            string s2 = e2.ToString("H");
            TestLibrary.TestFramework.LogError("101", "The ArgumentException was not thrown as expected");
            retVal = false;
        }
        catch (FormatException)
        {
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("102", "Unexpected exception: " + e);
            retVal = false;
        }

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

        TestLibrary.TestFramework.BeginScenario("PosTest3: Using the Format string \"F\"");

        try
        {
            e_test e3 = e_test.itemA;
            string s3 = e3.ToString("F");
            if (s3 != "itemA")
            {
                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 PosTest5()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest5: Using the empty string as the argument");

        try
        {
            e_test e3 = e_test.itemA;
            string s3 = e3.ToString("");
            if (s3 != "itemA")
            {
                TestLibrary.TestFramework.LogError("009", "The result is not the value as expected");
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("010", "Unexpected exception: " + e);
            retVal = false;
        }

        return(retVal);
    }