About 94,800,000 results
Open links in new tab
  1. c# - What is use of Moq? - Stack Overflow

    Mar 24, 2009 · Moq is a mocking framework for C#/.NET. It is used in unit testing to isolate your class under test from its dependencies and ensure that the proper methods on the dependent …

  2. Using Moq to mock only some methods - Stack Overflow

    Using Moq to mock only some methods Asked 14 years, 10 months ago Modified 2 years, 7 months ago Viewed 90k times

  3. How to install Moq framework - Stack Overflow

    Jan 21, 2020 · I plan on using Moq to mock some interfaces in the unit test code I've created. I've already downloaded the latest version of Moq. My question is how do I install it? Where should …

  4. unit testing - Mocking using Moq in c# - Stack Overflow

    Mar 23, 2017 · Classic example which demonstrates that if you cannot unit test a particular component, REFACTOR it! This is why I love what any mocking framework enforces you to do …

  5. How to mock a function call on a concrete object with Moq?

    Oct 7, 2014 · 57 You should use Moq to create your Mock object and set CallBase property to true to use the object behavior. From the Moq documentation: CallBase is defined as “Invoke …

  6. Moq - How to return a mocked object from a method?

    Jun 24, 2012 · Thanks! As I see it Moq is an aid for testing, it mocks away all the dependencies so that you can test the logic of the code under test. You can do everything that Moq does …

  7. c# - Moq: How to get to a parameter passed to a method of a …

    Moq is good at letting you know whether there was a matching call, but specific asserts give you much better information. The main drawback to my approach is losing the type safety and …

  8. unit testing - When mocking a class with Moq, how can I CallBase …

    I really appreciate Moq's Loose mocking behaviour that returns default values when no expectations are set. It's convenient and saves me code, and it also acts as a safety measure: …

  9. c# - Mocking HttpClient in unit tests - Stack Overflow

    Apr 5, 2016 · Moq.Contrib.HttpClient Like the solution for using Moq by itself, this is straightforward if you are familiar with using the Moq framework. I found this solution to be …

  10. Can you help me understand Moq Callback? - Stack Overflow

    May 14, 2010 · Using Moq and looked at Callback but I have not been able to find a simple example to understand how to use it. Do you have a small working snippet which clearly …