Mocking successive calls of similar type via sequential mocking
Posted
on Dot net Slackers
See other posts from Dot net Slackers
Published on Mon, 31 May 2010 00:00:00 GMT
Indexed on
2010/06/01
0:34 UTC
Read the original article
Hit count: 475
Filed under:
In this post , i show how you can benefit from sequential mocking feature[In JustMock] for setting up expectations with successive calls of same type. To start lets first consider the following dummy database and entity class. public class Person { public virtual string Name { get; set; } public virtual int Age { get; set; } } public interface IDataBase { T Get<T>(); } Now, our test goal is to return different entity for successive calls on IDataBase.Get<T>()....
Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.
© Dot net Slackers or respective owner