About 25,800,000 results
Open links in new tab
  1. 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.

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

  3. Mocking member variables of a class using Mockito

    Mocking member variables of a class using Mockito Asked 13 years, 10 months ago Modified 4 years, 9 months ago Viewed 424k times

  4. c# - Mock a method for test - Stack Overflow

    I have surrounded the above with actual class names to hopefully make it more obvious that we're mocking the class MyProgram and providing a new implementation (mock) of GetLastName() …

  5. Using Mockito to mock classes with generic parameters

    Is there a clean method of mocking a class with generic parameters? Say I have to mock a class Foo<T> which I need to pass into a method that expects a Foo<Bar>. I can do the …

  6. Unit testing with mockito for constructors - Stack Overflow

    I have used "Pattern 2 - the "factory helper pattern" Pattern 2 - the factory helper pattern One case where this pattern won't work is if MyClass is final. Most of the Mockito framework …

  7. How do I use Moq to mock an extension method? - Stack Overflow

    Mocking that result seemed the obvious choice but Moq doesn't seem to offer a way to override a static method (a requirement for an extension method). There is a similar idea with …

  8. How can I mock requests and the response? - Stack Overflow

    this solution works great with the GET request. I am trying to generalise it for POST and PUT but cannot understand, how I can supply extra data to be used inside the mocked_requests_get. …

  9. c# - Mock BlobClient for Azure Function - Stack Overflow

    Jan 8, 2022 · Each of the Azure SDK clients follows mocking guidelines that allow their behavior to be overridden: Each client offers at least one protected constructor to allow inheritance for …

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