Hello All
Please don't roll around laughing, please.
I have this code in some code I am trying to test and I want to mock it out so that he.SaveEntry does not get called.....
Dim he As New HistoryEntry(doc, historyentry)
he.SaveEntry()
This is what I am trying to mock it out with but you guessed it SaveEntry() gets called and you end up in the database (scream). Not a good place to be in a unit test.
Dim historyEntry As IHistoryEntry = MockRepository.GenerateMock(Of HistoryEntry)(parentContent, "test")
historyEntry.Stub(Sub() historyEntry.SaveEntry())
The background to this is that I am trying to see if I can unit test this code at all. There is a huge amount of other stuff that I have mocked out and it's not nice.
regards
Peter