Example #1
0
        public static Activity ConvertReferenceAndValidate <TResult>(Expression <Func <ActivityContext, TResult> > expr, Activity expectedActivity, Exception expectedException)
        {
            bool     expectSuccess = expectedException == null ? true : false;
            Activity act           = ExpressionTestRuntime.ConvertReference(expr, expectedException);

            if (expectSuccess)
            {
                ExpressionTestRuntime.ValidateActivity(act, expectedActivity);
            }

            act = ExpressionTestRuntime.TryConvertReference(expr, expectSuccess);
            if (expectSuccess)
            {
                ExpressionTestRuntime.ValidateActivity(act, expectedActivity);
            }

            return(act);
        }
Example #2
0
        public void TryConvertReferenceNull()
        {
            Expression <Func <ActivityContext, int> > expression = null;

            ExpressionTestRuntime.TryConvertReference(expression, false);
        }