Beispiel #1
0
        public void ContinueWithShouldThrowException_ForStaticMethodCall_FromFuncTaskTypedExpression_WhenClientIsNull()
        {
            Expression <Func <Task> > methodCall = () => TestClass.TestStaticTaskMethod();

            var exception = Assert.Throws <ArgumentNullException>(
                () => BackgroundJobClientExtensions.ContinueWith(
                    null, ParentJobId, methodCall));

            Assert.Equal("client", exception.ParamName);
        }
Beispiel #2
0
        public void GenericContinueWithShouldThrowException_ForInstanceMethodCall_FromActionTypedExpression_WhenClientIsNull()
        {
            Expression <Action <TestClass> > methodCall = x => x.TestInstanceMethod();

            var exception = Assert.Throws <ArgumentNullException>(
                () => BackgroundJobClientExtensions.ContinueWith(
                    null, ParentJobId, methodCall));

            Assert.Equal("client", exception.ParamName);
        }
Beispiel #3
0
        public void ContinueWithShouldThrowException_WithJobContinuationOptions_ForStaticMethodCall_FromActionTypedExpression_WhenClientIsNull()
        {
            Expression <Action> methodCall = () => TestClass.TestStaticMethod();

            var exception = Assert.Throws <ArgumentNullException>(
                () => BackgroundJobClientExtensions.ContinueWith(
                    null, ParentJobId, methodCall, JobContinuationOptions.OnAnyFinishedState));

            Assert.Equal("client", exception.ParamName);
        }