有人在使用Machine.Specifications.Mvc时遇到过这种情况吗?
我设置了一个规范来测试控制器操作的结果。在这种情况下:
[Subject("User views the dashboard")]
public class When_a_user_views_the_vendors_page
: ManagementContext
{
static ActionResult result;
Because of = () => result = manageController.Vendors();
It should_contain_a_list_of_vendors = () => {
result.ShouldBeAView().And().ShouldHaveModelOfType<List<Core.Vendor>>();
};
}我每次遇到的错误是:
在Machine.Specifications.SpecificationException: 206中,
应该是System.Web.Mvc.ViewResult类型,但在实际的d:\BuildAgent-01\work\340c36596c29db8\Source\Machine.Specifications\ExtensionMethods.cs:line中是System.Web.Mvc.ViewResult类型。
有人看过这个吗?有什么简单的办法解决这个问题吗?这似乎发生在Machine.Specifications库中。我甚至在调试模式下运行它来检查值,它们实际上都是ViewResult对象,甚至具有正确的模型数据。
提前感谢
发布于 2010-02-23 16:07:35
好吧..。愚蠢的问题。(我就知道会这样)。我最近开始用MVC2做实验。Machine.Specifications.Mvc开箱即接至1.0;
我把Machine.Specifications.Mvc重新引用到Mvc2,它就像一种魅力。
doh!:)
https://stackoverflow.com/questions/2314773
复制相似问题