ASP.Net MVC 起订量设置获取
我开始使用 TDD 使用 Moq 来模拟我拥有的接口:
public interface IDataService
{
void Commit();
TopListService TopLists { get; }
}
从我看到的示例中,我希望在我键入时 SetupGet (或 Setup)出现在智能感知中,
var mockDataService = new Mock<IDataService>();
mockDataService.
但它丢失了。有人可以建议为什么吗?
I am starting out with TDD using Moq to Mock an interface that I have:
public interface IDataService
{
void Commit();
TopListService TopLists { get; }
}
From the samples I have seen I would expect SetupGet (or Setup) to appear in the intellisense when I type
var mockDataService = new Mock<IDataService>();
mockDataService.
But it is missing. Could someone suggest why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
确保您使用的是最新版本的 Moq< /a>.
Make sure you are using the latest version of Moq.
这听起来像是您的项目设置的问题,而不是起订量的问题。
Mock
将毫无意义)。Mock
是否为Moq.Mock
,而不是来自其他命名空间。如果您可以键入应该运行的代码并使其构建,那么 Visual Studio 肯定会发挥作用。
It sounds like a problem with your project setup, rather than with Moq.
Mock<IDataService>
will be meaningless).Mock
you're using isMoq.Mock
and not from another namespace.If you can type the code that ought to work and make it build, then it's definitely Visual Studio playing up.