public void Delete_ThrowsAnException_WhenClientIsNull()
        {
            var exception = Assert.Throws <ArgumentNullException>(
                () => BackgroundJobClientExtensions.Delete(null, JobId));

            Assert.Equal("client", exception.ParamName);
        }
        public void ChangeState_WithoutFromState_ThrowsAnException_WhenClientIsNull()
        {
            var exception = Assert.Throws <ArgumentNullException>(
                () => BackgroundJobClientExtensions.ChangeState(null, "job-id", _state.Object));

            Assert.Equal("client", exception.ParamName);
        }
        public void Requeue_ThrowsAnException_WhenClientIsNull()
        {
            var exception = Assert.Throws <ArgumentNullException>(
                () => BackgroundJobClientExtensions.Requeue(null, JobId, FailedState.StateName));

            Assert.Equal("client", exception.ParamName);
        }
Пример #4
0
        public void StaticSchedule_WithDateTimeOffset_ThrowsAnException_WhenClientIsNull()
        {
            var exception = Assert.Throws <ArgumentNullException>(
                () => BackgroundJobClientExtensions.Schedule(
                    null, () => StaticMethod(), DateTimeOffset.UtcNow));

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

            Assert.Equal("client", exception.ParamName);
        }
        public void InstanceSchedule_ThrowsAnException_WhenClientIsNull()
        {
            var exception = Assert.Throws <ArgumentNullException>(
                () => BackgroundJobClientExtensions.Schedule <BackgroundJobClientExtensionsFacts>(
                    null, x => x.InstanceMethod(), TimeSpan.FromDays(1)));

            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 StaticCreate_ThrowsAnException_WhenClientIsNull()
        {
            var exception = Assert.Throws <ArgumentNullException>(
                () => BackgroundJobClientExtensions.Create(
                    null, () => StaticMethod(), _state.Object));

            Assert.Equal("client", exception.ParamName);
        }
Пример #9
0
        public void InstanceSchedule_WithDateTimeOffset_ThrowsAnException_WhenClientIsNull()
        {
            var exception = Assert.Throws <ArgumentNullException>(
                () => BackgroundJobClientExtensions.Schedule <BackgroundJobClientExtensionsFacts>(
                    null, x => x.InstanceMethod(), DateTimeOffset.UtcNow));

            Assert.Equal("client", exception.ParamName);
        }
        public void StaticSchedule_ThrowsAnException_WhenClientIsNull()
        {
            var exception = Assert.Throws <ArgumentNullException>(
                () => BackgroundJobClientExtensions.Schedule(
                    null, () => StaticMethod(), TimeSpan.FromDays(1)));

            Assert.Equal("client", exception.ParamName);
        }
Пример #11
0
        public void GenericCreateShouldThrowException_ForInstanceMethodCall_FromFuncTaskTypedExpression_WhenClientIsNull()
        {
            Expression <Func <TestClass, Task> > methodCall = x => x.TestInstanceTaskMethod();

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

            Assert.Equal("client", exception.ParamName);
        }
Пример #12
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);
        }
Пример #13
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);
        }
Пример #14
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);
        }
Пример #15
0
        public void CreateShouldThrowException_ForStaticMethodCall_FromActionTypedExpression_WhenClientIsNull()
        {
            Expression <Action> methodCall = () => TestClass.TestStaticMethod();

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

            Assert.Equal("client", exception.ParamName);
        }
Пример #16
0
        public void GenericScheduleShouldThrowException_WithSetRunTime_ForInstanceMethodCall_FromFuncTaskTypedExpression_WhenClientIsNull()
        {
            var runAt = DateTime.UtcNow.AddHours(1);

            Expression <Func <TestClass, Task> > methodCall = x => x.TestInstanceTaskMethod();

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

            Assert.Equal("client", exception.ParamName);
        }
Пример #17
0
        public void ScheduleShouldThrowException_WithSetRunTime_ForStaticMethodCall_FromActionTypedExpression_WhenClientIsNull()
        {
            var runAt = DateTime.UtcNow.AddHours(1);

            Expression <Action> methodCall = () => TestClass.TestStaticMethod();

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

            Assert.Equal("client", exception.ParamName);
        }
Пример #18
0
        public void GenericScheduleShouldThrowException_WithDelay_ForInstanceMethodCall_FromActionTypedExpression_WhenClientIsNull()
        {
            var runAt = DateTime.UtcNow.AddHours(1);
            var delay = runAt.Subtract(DateTime.UtcNow);

            Expression <Action <TestClass> > methodCall = x => x.TestInstanceMethod();

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

            Assert.Equal("client", exception.ParamName);
        }
Пример #19
0
        public void ScheduleShouldThrowException_WithDelay_ForStaticMethodCall_FromFuncTaskTypedExpression_WhenClientIsNull()
        {
            var runAt = DateTime.UtcNow.AddHours(1);
            var delay = runAt.Subtract(DateTime.UtcNow);

            Expression <Func <Task> > methodCall = () => TestClass.TestStaticTaskMethod();

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

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