Mocking with Moq

You may also like...

  • Pingback: Entity Framework, Database First, Mocks... 1/2 - Context is king...()

  • Donkey Brains

    Ref line 10 in simpletest

    Mock is an abstract class, and you cant new up abstract classes.

    var repository = new Mock();

    • Hi,
      Absolutely right, thanks for letting me know :). Actually this post had some csharp code formatting issues and the <> brackets were removed.
      I made the needed corrections.

  • very informative. thanks.

  • Anonymous

    very cool article ! it saved my time thank you so much

  • smokes

    tnx. really great article.

  • Moq was my favourite .NET mocking framework until I discovered FakeItEasy 😉

    • Zoran Maksimovic

      I found very good FakeItEasy reviews on the net, but haven’t used or tried it yet. For what could I see in the examples FiE doesn’t do anything revolutionary that makes it much better than Moq. One may like better FiE notation but all in all I find Moq and FiE pretty similar. I think in the end is just the personal “taste”:) In any case, easier to use the better, so let’s go for the simplicity! For sure I will give FakeItEasy a try.