Fake a member without worrying about passing the dependency
Posted by: Mehfuzs WebLog,
on 21 Jul 2011 |
View original | Bookmarked: 0 time(s)
I have came across this several times in forum (telerik) on how I can really fake an item yet I dont want to pass the instance as an argument. Ideally, this is not a best design but there are third- partly libraries that you have little control over how its written. Anyway, whatever the case might be. This post will show you how you can achieve the above using JustMock. I will be using MSpec in conjunction for the example. So here is the sample class that I am going to use: ...