MockPremiumCalculationService = new Mock<IPremiumCalculationService> (); PremiumCalculationResponse response1 = new PremiumCalculationResponse (); response1.Premium = 55; PremiumCalculationResponse response2 = new PremiumCalculationResponse (); response2.Premium = 60; MockPremiumCalculationService.Setup ( pcs => pcs.Calculate (It.IsAny<PremiumCalculationRequest> ())) .ReturnsInOrder (response1, response2);
For more info see this article by Phil Haack:
http://haacked.com/archive/2009/09/29/moq-sequences.aspx
No comments:
Post a Comment