Moq, strict vs loose usage

前端 未结 4 607
盖世英雄少女心
盖世英雄少女心 2020-12-13 08:11

In the past, I have only used Rhino Mocks, with the typical strict mock. I am now working with Moq on a project and I am wondering about the proper usage.

Let\'s as

4条回答
  •  Happy的楠姐
    2020-12-13 09:00

    Me personally, being new to mocking and Moq feel that starting off with Strict mode helps better understand of the innards and what's going on. "Loose" sometimes hides details and pass a test which a moq beginner may fail to see. Once you have your mocking skills down - Loose would probably be a lot more productive - like in this case saving a line with the "Setup" and just using "Verify" instead.

提交回复
热议问题