本文介绍了Mono 2.4和RhinoMocks 3.5中的扩展方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Ubuntu中使用MonoDevelop 2.0和Mono 2.4.

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

我遇到了RhinoMocks 3.5中无法进行AAA风格测试的扩展方法(例如,mockView.Stub(...))的问题.我是从Ayende的网站下载RhinoMocks dll的,而不是从源代码编译的.我在MonoDevelop中的项目设置为目标框架3.5

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

在RhinoMocksExtensions类上使用带有静态方法的RhinoMocks c#2.0语法是有效的. (例如RhinoMocksExtensions.Stub(authSvc,委托(IAuthService svc))

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

AAA语法(通常是RhinoMocks)应该与Mono 2.4一起使用还是可能我没有正确设置某些内容?

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

预先感谢

尼尔

推荐答案

确保您正在引用System.Core

Ensure that you are referencing System.Core

这篇关于Mono 2.4和RhinoMocks 3.5中的扩展方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 15:28