About 30,000,000 results
Open links in new tab
  1. unit testing - What is Mocking? - Stack Overflow

    Apr 19, 2010 · What is Mocking? .Mocking is primarily used in unit testing. An object under test may have dependencies on other (complex) objects. To isolate the behaviour of the object you …

  2. What's the difference between faking, mocking, and stubbing?

    Dec 6, 2008 · For example, mocking network requests allows you to test positive cases and fault cases without the unpredictable nature of actual network calls. Mocks will often include some …

  3. mocking - Swagger/OpenAPI mock server - Stack Overflow

    Feb 12, 2020 · Mocking is supported on both free and paid plans. To use the mock server, import your spec into SwaggerHub and enable "API Auto Mocking". Mock responses can be JSON, …

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

    Apr 5, 2016 · I have some issues trying to wrap my code to be used in unit tests. The issues is this. I have the interface IHttpHandler: public interface IHttpHandler { HttpClient client { get; } } …

  5. What is the purpose of mock objects? - Stack Overflow

    Sep 2, 2010 · Also note that this is a pretty simplistic example and that mocking frameworks allow for some pretty sophisticated specifications of expected behavior from components to support …

  6. mocking - How can I mock the JavaScript 'window' object using …

    9 The window object in Jest is self-mocking One of the things unaddressed in other answers is a comment by the OP: Using Jest, I don't know how to mock the window. The window object is …

  7. Mocking Extension Methods with Moq - Stack Overflow

    Feb 19, 2010 · Mocking Extension Methods with Moq Asked 15 years, 9 months ago Modified 2 years, 5 months ago Viewed 245k times

  8. java - Mocking static methods with Mockito - Stack Overflow

    Mocking the static methods is considered to be a bad practice. If you try to do that, it means there is something wrong with the way you want to perform testing.

  9. Using Jest to mock a React component with props - Stack Overflow

    Jun 7, 2017 · Here's an alternative (better?) way of dealing with mocking components that need to be passed props: using module mock files. First create a file with the same name as the …

  10. java - How to mock a final class with mockito - Stack Overflow

    Jan 12, 2013 · Mocking of final classes and methods is an incubating, opt-in feature. It uses a combination of Java agent instrumentation and subclassing in order to enable mockability of …