public void InstanceCreate_ThrowsAnException_WhenClientIsNull()
        {
            var exception = Assert.Throws <ArgumentNullException>(
                () => BackgroundJobClientExtensions.Create <BackgroundJobClientExtensionsFacts>(
                    null, x => x.InstanceMethod(), _state.Object));

            Assert.Equal("client", exception.ParamName);
        }
        public void StaticCreate_ThrowsAnException_WhenClientIsNull()
        {
            var exception = Assert.Throws <ArgumentNullException>(
                () => BackgroundJobClientExtensions.Create(
                    null, () => StaticMethod(), _state.Object));

            Assert.Equal("client", exception.ParamName);
        }
예제 #3
0
        public void GenericCreateShouldThrowException_ForInstanceMethodCall_FromActionTypedExpression_WhenClientIsNull()
        {
            Expression <Action <TestClass> > methodCall = x => x.TestInstanceMethod();

            var exception = Assert.Throws <ArgumentNullException>(
                () => BackgroundJobClientExtensions.Create(
                    null, methodCall, _state.Object));

            Assert.Equal("client", exception.ParamName);
        }
예제 #4
0
        public void CreateShouldThrowException_ForStaticMethodCall_FromFuncTaskTypedExpression_WhenClientIsNull()
        {
            Expression <Func <Task> > methodCall = () => TestClass.TestStaticTaskMethod();

            var exception = Assert.Throws <ArgumentNullException>(
                () => BackgroundJobClientExtensions.Create(
                    null, methodCall, _state.Object));

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