Mocking method results

前端 未结 6 1581
情歌与酒
情歌与酒 2021-02-08 16:00

I\'m trying to find a way to fake the result of a method called from within another method.

I have a \"LoadData\" method which calls a separate helper to get some data a

6条回答
  •  感情败类
    2021-02-08 16:33

    Yes, a mocking framework is exactly what you're looking for. You can record / arrange how you want certain mocked out / stubbed classes to return.

    Rhino Mocks, Typemock, and Moq are all good options for doing this.

    Steven Walther's post on using Rhino Mocks helped me a lot when I first started playing with Rhino Mocks.

提交回复
热议问题