- 授权协议: BSD
- 开发语言: C# .NET
- 操作系统: Windows
- 软件首页: https://github.com/Moq/moq4
- 软件文档: https://github.com/Moq/moq4/wiki/Quickstart
软件介绍
示例代码:
var mock = new Mock<ILoveThisFramework>();
// WOW! No record/replay weirdness?! :)
mock.Setup(framework => framework.DownloadExists("2.0.0.0"))
.Returns(true)
.AtMostOnce();
// Hand mock.Object as a collaborator and exercise it,
// like calling methods on it...
ILoveThisFramework lovable = mock.Object;
bool download = lovable.DownloadExists("2.0.0.0");
// Verify that the given method was indeed called with the expected value
mock.Verify(framework => framework.DownloadExists("2.0.0.0"));
