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

  4. python - Mocking a class: Mock () or patch ()? - Stack Overflow

    I am using mock with Python and was wondering which of those two approaches is better (read: more pythonic). Method one: Just create a mock object and use that. The code looks like: def test_one (s...

  5. Simplify mocking dependencies with @InjectMocks - Stack Overflow

    Jun 12, 2025 · Simplify mocking dependencies with @InjectMocks Asked 8 months ago Modified 8 months ago Viewed 230 times

  6. java - Spring boot 4 and RestClient Mocking - Stack Overflow

    Dec 9, 2025 · I am in the process of migrating one of our application to Spring Boot 4.0.0. One of the changes I tried to incorporate is using the RestClient. Code-wise all the changes are fine and …

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

  8. What's the difference between a mock & stub? - Stack Overflow

    Aug 11, 2010 · I've read various articles about mocking vs stubbing in testing, including Martin Fowler's Mocks Aren't Stubs, but still don't understand the difference.

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

    Mar 23, 2017 · In this case, how to create unit test for CreateProduct method by mocking the IProductDataAccess interface? I thought of having an public instance of IProductDataAccess within …

  10. What is a mock and when should you use it? - Stack Overflow

    Mar 16, 2010 · A mock object is not just an object with known values. It is an object that has the same interface as a complex object that you cannot use in test (like a database connection and result …