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

        TestLibrary.TestFramework.BeginScenario("PosTest12: Return value is void, with 1 reference parameter and 1 value parameter");
        try
        {
            DelegateDefinitions dd = new DelegateDefinitions();
            dd.ReferenceValueParameterVoidDelegate =
                new ReferenceValueParameterVoidDelegate(dd.TestReferenceValueParameterVoidCallback);
            if (null == dd.ReferenceValueParameterVoidDelegate)
            {
                TestLibrary.TestFramework.LogError("030", "Failed to assign a call back function to a delegate");
                retVal = false;
            }

            dd.ReferenceValueParameterVoidDelegate(
                DelegateDefinitions.c_DELEGATE_TEST_DEFAUTL_REFERENCE_PARAMETER,
                DelegateDefinitions.c_DELEGATE_TEST_DEFAULT_VALUE_PARAMETER);
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("031", "Unexpected exception: " + e);
            TestLibrary.TestFramework.LogInformation(e.StackTrace);
            retVal = false;
        }

        return(retVal);
    }
Ejemplo n.º 2
0
    public bool NegTest4()
    {
        bool retVal = true;

        TestLibrary.TestFramework.BeginScenario("NegTest4: Return type is void with 1 reference type parameter and 1 value  type parameter");

        try
        {
            DelegateDefinitions dd = new DelegateDefinitions();
            dd.ReferenceValueParameterVoidDelegate =
                new ReferenceValueParameterVoidDelegate(dd.TestReferenceValueParameterVoidCallbackWithNullValue);

            dd.ReferenceValueParameterVoidDelegate(null, DelegateDefinitions.c_DELEGATE_TEST_DEFAULT_VALUE_PARAMETER);
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("051", "Unexpected exception: " + e);
            TestLibrary.TestFramework.LogInformation(e.StackTrace);
            retVal = false;
        }

        return(retVal);
    }
Ejemplo n.º 3
0
    public bool NegTest4()
    {
        bool retVal = true;
        
        TestLibrary.TestFramework.BeginScenario("NegTest4: Return type is void with 1 reference type parameter and 1 value  type parameter");

        try
        {
            DelegateDefinitions dd = new DelegateDefinitions();
            dd.ReferenceValueParameterVoidDelegate =
                new ReferenceValueParameterVoidDelegate(dd.TestReferenceValueParameterVoidCallbackWithNullValue);

            dd.ReferenceValueParameterVoidDelegate(null, DelegateDefinitions.c_DELEGATE_TEST_DEFAULT_VALUE_PARAMETER);
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("051", "Unexpected exception: " + e);
            TestLibrary.TestFramework.LogInformation(e.StackTrace);
            retVal = false;
        }

        return retVal;
    }
Ejemplo n.º 4
0
    public bool PosTest12()
    {
        bool retVal = true;
        
        TestLibrary.TestFramework.BeginScenario("PosTest12: Return value is void, with 1 reference parameter and 1 value parameter");
        try
        {
            DelegateDefinitions dd = new DelegateDefinitions();
            dd.ReferenceValueParameterVoidDelegate =
                new ReferenceValueParameterVoidDelegate(dd.TestReferenceValueParameterVoidCallback);
            if (null == dd.ReferenceValueParameterVoidDelegate)
            {
                TestLibrary.TestFramework.LogError("030", "Failed to assign a call back function to a delegate");
                retVal = false;
            }

            dd.ReferenceValueParameterVoidDelegate(
                DelegateDefinitions.c_DELEGATE_TEST_DEFAUTL_REFERENCE_PARAMETER,
                DelegateDefinitions.c_DELEGATE_TEST_DEFAULT_VALUE_PARAMETER);
        }
        catch (Exception e)
        {
            TestLibrary.TestFramework.LogError("031", "Unexpected exception: " + e);
            TestLibrary.TestFramework.LogInformation(e.StackTrace);
            retVal = false;
        }

        return retVal;
    }