internal static ReturnsValidationFixture.IType ExtensionMethod( this ReturnsValidationFixture fixture, object arg1, object arg2 ) { return(default(ReturnsValidationFixture.IType)); }
public void Returns_does_not_accept_extension_method_with_wrong_parameter_count() { Func <object, object, IType> delegateWithWrongParameterCount = new ReturnsValidationFixture().ExtensionMethod; var ex = Record.Exception(() => { this.setupNoArgs.Returns(delegateWithWrongParameterCount); }); Assert.IsType <ArgumentException>(ex); }
public void Returns_accepts_extension_method_with_correct_parameter_count() { Func <object, object, IType> delegateWithCorrectParameterCount = new ReturnsValidationFixture().ExtensionMethod; this.setup.Returns(delegateWithCorrectParameterCount); var ex = Record.Exception(() => { this.mock.Object.Method(42, 5); }); Assert.Null(ex); }
public void Returns_accepts_parameterless_extension_method_even_for_method_having_parameters() { Func <IType> delegateWithoutParameters = new ReturnsValidationFixture().ExtensionMethodNoArgs; this.setup.Returns(delegateWithoutParameters); var ex = Record.Exception(() => { this.mock.Object.Method(42, 5); }); Assert.Null(ex); }
internal static ReturnsValidationFixture.IType ExtensionMethodNoArgs(this ReturnsValidationFixture fixture) { return(default(ReturnsValidationFixture.IType)); }