public bool PosTest11()
    {
        bool retVal = true;

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

        try
        {
            DelegateDefinitions dd = new DelegateDefinitions();
            dd.ValueReferenceParameterVoidDelegate =
                new ValueReferenceParameterVoidDelegate(dd.TestValueReferenceParameterVoidCallback);
            if (null == dd.ValueReferenceParameterVoidDelegate)
            {
                TestLibrary.TestFramework.LogError("028", "Failed to assign a call back function to a delegate");
                retVal = false;
            }

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

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

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

        try
        {
            DelegateDefinitions dd = new DelegateDefinitions();
            dd.ValueReferenceParameterVoidDelegate =
                new ValueReferenceParameterVoidDelegate(dd.TestValueReferenceParameterVoidCallbackWithNullValue);

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

        return(retVal);
    }
Exemplo n.º 3
0
    public bool NegTest3()
    {
        bool retVal = true;

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

        try
        {
            DelegateDefinitions dd = new DelegateDefinitions();
            dd.ValueReferenceParameterVoidDelegate =
                new ValueReferenceParameterVoidDelegate(dd.TestValueReferenceParameterVoidCallbackWithNullValue);

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

        return retVal;
    }
Exemplo n.º 4
0
    public bool PosTest11()
    {
        bool retVal = true;

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

        try
        {
            DelegateDefinitions dd = new DelegateDefinitions();
            dd.ValueReferenceParameterVoidDelegate =
                new ValueReferenceParameterVoidDelegate(dd.TestValueReferenceParameterVoidCallback);
            if (null == dd.ValueReferenceParameterVoidDelegate)
            {
                TestLibrary.TestFramework.LogError("028", "Failed to assign a call back function to a delegate");
                retVal = false;
            }

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

        return retVal;
    }