I've got a method that's mildly complicated and needs to be very well tested. Secret sauce stuff. Ok, maybe not that cool, but I'm not 100% sure how to go about getting these things setup. This sort of stems from my previous question here. I haven't used rhino mocks so I'm still bad/unaware of the syntax, so feel free to make a ton of suggestions.
Public Function GenerateAllNotifications(ByVal days As List(Of Integer)) As List(Of MailMessage) Implements INotificationService.GenerateAllNotifications
Dim someStuff = _someService.GetThingsThatExpireBetween(day1, day2)
'build some messages
Return messages
End Function
My setup in my tests are looking like this ... I know this is wrong though
Dim fakeStuff = New SomeItem()
Dim fakeContext = New List(Of Provider)
fakeContext.Add(fakeStuff)
Dim someService = MockRepository.GenerateStub(Of ISomeService)()
someService.Stub(Function(x) x.GetThingsThatExpireBetween(30, 60)).IgnoreArguments().Return(fakeContext.AsQueryable)
_fakeNotificationService = New NotificationService(someService)
What I want to accomplish is returning an execpted items out of that service. The business rule is a collection of messages based on that given expiration. So if a given entity is expiring in 30 days, the message reflects that, if it's 60, 90, whatever, those are put in the messages. I think my problem is I need to have different objects come back (someitem) each time ... ?