Extension methods in Mono 2.4 and RhinoMocks 3.5

2019-05-24 12:21发布

I am playing around with MonoDevelop 2.0 and Mono 2.4 in Ubuntu.

I have run into problems with extension methods not being available (eg mockView.Stub(...)) in RhinoMocks 3.5 for AAA style tests. I downloaded the RhinoMocks dll from Ayende's site rather than compiled from source. My project in MonoDevelop is setup to target framework 3.5

Using the RhinoMocks c#2.0 syntax with static methods on the RhinoMocksExtensions class works. (e.g RhinoMocksExtensions.Stub(authSvc, delegate(IAuthService svc))

Should AAA syntax (and RhinoMocks in general) work with Mono 2.4 or is it likely I've not setup something correctly?

Thanks in advance

Neil

1条回答
地球回转人心会变
2楼-- · 2019-05-24 12:35

Ensure that you are referencing System.Core

查看更多
登录 后发表回答