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

        TestLibrary.TestFramework.BeginScenario("PosTest2: Call GetBaseException when InnerException property is not null reference");

        try
        {
            TestException desired = new TestException();
            Exception     ex      = new Exception(
                TestLibrary.Generator.GetString(-55, false, c_MIN_STRING_LENGTH, c_MAX_STRING_LENGTH),
                desired);
            Exception actual = ex.GetBaseException();

            if (!desired.Equals(actual))
            {
                TestLibrary.TestFramework.LogError("002.1", "Calling GetBaseException when InnerException property is not null reference does not return current exception instance");
                TestLibrary.TestFramework.LogInformation("WARNING [LOCAL VARIABLES] desired = " + desired + ", actual = " + actual);
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("002.0", "Unexpected exception: " + e);
            TestLibrary.TestFramework.LogInformation(e.StackTrace);
            retVal = false;
        }

        return(retVal);
    }
    public bool PosTest2()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("PosTest2: Call GetBaseException when InnerException property is not null reference");

        try
        {
            TestException desired = new TestException();
            Exception ex = new Exception(
                TestLibrary.Generator.GetString(-55, false, c_MIN_STRING_LENGTH, c_MAX_STRING_LENGTH),
                desired);
            Exception actual = ex.GetBaseException();

            if (!desired.Equals(actual))
            {
                TestLibrary.TestFramework.LogError("002.1", "Calling GetBaseException when InnerException property is not null reference does not return current exception instance");
                TestLibrary.TestFramework.LogInformation("WARNING [LOCAL VARIABLES] desired = " + desired + ", actual = " + actual);
                retVal = false;
            }
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("002.0", "Unexpected exception: " + e);
            TestLibrary.TestFramework.LogInformation(e.StackTrace);
            retVal = false;
        }

        return retVal;
    }