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); }
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); }
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); }