public void You_can_setup_a_method_with_a_static_that_returns_a_reference_type_via_a_lambda_without_specifying_return_type() { //a method with parameters mocker.Setup <IService4>(s => s.MainMethodName(WithStatic.Get())) .Returns <string>(s => s += "2"); var mock = mocker.Get <IService4>(); mock.MainMethodName(WithStatic.Get()).ShouldEqual("2"); }
public void You_can_setup_a_method_with_a_static_that_returns_a_reference_type_via_a_lambda_without_specifying_return_type() { var mocker = new AutoMocker(); //a method with parameters mocker.Setup <IService4, string>(s => s.MainMethodName(WithStatic.Get())) .Returns <string>(s => s + "2"); var mock = mocker.Get <IService4>(); Assert.AreEqual("2", mock.MainMethodName(WithStatic.Get())); }