English 中文(简体)
写作TDD单位测试回收方法
原标题:Writing TDD unit test for method that returns IEnumerable<IResult> (Caliburn Micro)

我愿知道,我如何使用一种方法,从2010年视觉演播室的我的单位测试中回收IE。 我正在使用冲锋枪弹.。

问题回答

Something like this should be what you are looking for:

var expectedDatasets = new List<Dataset>{new Dataset()};
Expect.Call(service.FindDatasets()).Return(expectedDatasets);

由于名单安装了可计量的界面,你将能够说出你的期望;





相关问题
How to unit test file permissions in NUnit?

I m trying to unit test file read operations. In this scenario I also need make sure that, if a particular user don t have read access he should get an exception... But somehow I m unable to get it ...

Rhino mocks - does this test look sensible?

I have just crafted the following test using Rhino mocks. Does my test look valid and make sense to those more experienced with mocking? I am a a little confused that I haven t had to use the ...

How to mock Add method of subsonic s SimpleRepository

I m trying to mock the Add method of subsonic SimpleRepository with Rihino mocks, I m using the IRepository Interface but I m new to mocking and dont know how to go from there, can this be done? ...

StrucutureMap RhinoMock Record/Playback, Example needed

I m looking for some examples on how to do the following Mock Tests using StructureMap or Unity with NUnit. I have the following code structure public interface IDAL { List<Model> Method1(...

How do I Fake UpdateModel for ASP.Net MVC?

I am trying to unit test a controller action that uses UpdateModel but I am not correctly mocking the HttpContext. I keep getting the following exception: System.InvalidOperationException: ...

热门标签