About 50 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 want to …

  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 metadata so …

  3. 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.

  4. python - Mocking a context manager - Stack Overflow

    You are setting the wrong mock: mock_tmp is not the context manager, but instead returns a context manager. Replace your setup line with:

  5. Use Mockito to mock some methods but not others

    Feb 20, 2013 · Partial mocking using Mockito's spy method could be the solution to your problem, as already stated in the answers above. To some degree I agree that, for your concrete use case, it …

  6. Mocking member variables of a class using Mockito

    Mocking member variables of a class using Mockito Asked 14 years, 2 months ago Modified 5 years, 1 month ago Viewed 425k times

  7. 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 these …

  8. Simplify mocking dependencies with @InjectMocks - Stack Overflow

    Jun 12, 2025 · Simplify mocking dependencies with @InjectMocks Ask Question Asked 9 months ago Modified 9 months ago

  9. c# - Mocking Extension Methods with Moq - Stack Overflow

    Feb 19, 2010 · Mocking Extension Methods with Moq Asked 16 years, 1 month ago Modified 2 years, 9 months ago Viewed 246k times

  10. 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; } } And the ...