I have something that looks like the following:
var someList = MockRepository.GenerateStub<IList<ISomething>>();
someList.Add(MockRepository.GenerateStub<ISomething>());
The list gets created as a proxy correctly. However, whenever I try to add an item to the list, it doesn't add the item to the list.
I have a feeling this is because the proxy class has no implementation of Add, but I'm wondering how I would remedy this situation without just doing this instead:
var someList = new List<ISomething>();
someList.Add(MockRepository.GenerateStub<ISomething>());
Why would I want to do this? Let's say I have my own special kind of list, say MySpecialList, which is an IList, but in my unit test I don't want to go through the hassle of instanting it, I'd rather just stub it's Add behavior.