Mocking and stubbing easier than ever with Moq 2.6
Posted by: eXtensible mind,
on 19 Nov 2008 |
View original | Bookmarked: 0 time(s)
I've just released a new version of Moq which contains a few bug fixes but two extremely useful features: recursive mocks and mocked default values. Recursive mocks Quite often you have a root mock object from which other mocks should "hang" through property accesses, such as HttpContextBase.Response: you want the response object returned to also be a mock. Setting such hierarchies before this release was quite verbose:var context = new Mock<HttpContextBase>();
var response = new Mock<HttpResponseBase>();
context.Expect(c...