首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > PSMock is a .NET mock framework capable of mocking all functions and properties.

PSMock is a .NET mock framework capable of mocking all functions and properties.

  • 资源大小:29.72 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: .net tdd unittesting Mock 3.5

资 源 简 介

PSMock PSMock is yet another .NET mock framework, but capable of mocking all functions and properties in a class. I.e. it is not necessary to crate mocked objects based on interfaces or virtual functions. The initial implementation is depending on the PostSharp framework to inject mock functionality into classes or function calls. Sample A sample on how a test function mocks an instance function: ``` using (Mock.Mocking) { // Verify that the unmocked Echo function returns the in-parameter as the result EchoClass mocked = new EchoClass(); Assert.That(mocked.Echo("real"), Is.EqualTo("real")); // Setup the mocked function to return "mock" regardless of the in-parameter using (Mock.Setup) { Mock.Function(mocked.Echo(null)) .Return("mock"); } // Verify that specified mocked return value is returned Assert.That(mocked.Echo("real&quo

文 件 列 表

PSMock_0.5.0_src
Build.bat
Build.proj
License.txt
PSMock
PSMock.sln
PSMockTest
readme.txt
Samples
SamplesTest
VIP VIP
0.303328s