public void StaticEnqueue_WithQueue_ThrowsAnException_WhenClientIsNull()
        {
            var exception = Assert.Throws <ArgumentNullException>(
                () => BackgroundJobClientExtensions.Enqueue(
                    null, () => StaticMethod(), "critical"));

            Assert.Equal("client", exception.ParamName);
        }
        public void InstanceEnqueue_ThrowsAnException_WhenClientIsNull()
        {
            var exception = Assert.Throws <ArgumentNullException>(
                () => BackgroundJobClientExtensions.Enqueue <BackgroundJobClientExtensionsFacts>(
                    null, x => x.InstanceMethod()));

            Assert.Equal("client", exception.ParamName);
        }
        public void EnqueueShouldThrowException_ForStaticMethodCall_FromFuncTaskExpression_WhenClientIsNull()
        {
            Expression <Func <Task> > methodCall = () => TestClass.TestStaticTaskMethod();

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

            Assert.Equal("client", exception.ParamName);
        }
        public void GenericEnqueueShouldThrowException_ForInstanceMethodCall_FromFuncTaskExpression_WhenClientIsNull()
        {
            Expression <Func <TestClass, Task> > methodCall = x => x.TestInstanceTaskMethod();

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

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