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. 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, YAML and …

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

  5. What is Object Mocking and when do I need it? - Stack Overflow

    Aug 7, 2008 · Object Mocking is used to keep dependencies out of your unit test. Sometimes you'll have a test like "SelectPerson" which will select a person from the database and return a Person object. …

  6. 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 - write decoupled …

  7. c# - Mocking and unit testing graphql-dotnet - Stack Overflow

    Nov 8, 2023 · I'm using graphql-dotnet library to query some GraphQL APIs from my C# code. Is there a way to easily mock the GraphQLHttpClient in unit tests?

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

  9. c# - Mocking EF DbContext with Moq - Stack Overflow

    I'm trying to create a unit test for my service with a mocked DbContext. I created an interface IDbContext with the following functions: public interface IDbContext : IDisposable { IDbSet<T...

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