I have the following method to test, which uses a function imported from a package. import x.y.z func abc() { ... v := z.SomeFunc() ... } Is it
I have a program that is only displaying bug behavior when a certain response is received from an external server. The only thing is, the external server is in
Is it possible to create a class under test with FakeItEasy, where all dependencies that are declared in the constructor are initialized automatically with fake
I need to configure multiple expectations on an instance of MockRestServiceServer. The expectations are for two different URLs: Call URL #1 Call URL #1 (for a
I tried in vain to mock a top-level (not part of any section) configuration value (.NET Core's IConfiguration). For example, neither of these will work (using
I'm using this, from here: constructor(private heroService: HeroService, private activatedRoute: ActivatedRoute) { } ngOnInit() { const heroId = this.
I have an api service that has 2 layer: api and repository. The api layer is where the request handling and business logic defined, while repository is a databa
I am writing a Unit test for a class that uses android.util.Base64 and I get this error: java.lang.RuntimeException: Method encode in android.util.Base64 not m
I am trying to write a simple test with moq. When calling the mocked method for the second time, after changing the return value from the first call, the moq fr
I'm completely new to Rhino Mocks and mocking in general. I'm still wrapping my head around how to code the mocks. I have a test class which contains something
I have a function as follows : private Response getHttpResponse(String url) { WebTarget target = client.target(url); Invocation.Builder requestBuilder =
I have a method in the class AppleProcessor which I would like to test: public void process(Fruit fruit) { if(fruit.getType() == Fruit.APPLE) { fru
I tried patching a provider class by decorating a test method with @patch: class TestMyUnit(unittest.TestCase): ... @patch(provider.Provider,autospec=True) def
I'm working with FastAPI. I've introduced in my test suite (pytest) app.dependency_overrides to test my app dependencies. Strangely enough, when I use it in a t
I am writing a project that takes advantage of the hiredis redis client library. What is the best approach to mock this library for use in writing tests? For
In my app I have generic repository connected to controller through UnitOfWork. I want to unit test my app. To make this I need to mock db connection. Can you t
all. Include details about your goal: I'm trying to mock repository in e2e test Describe expected and actual results: Request to server will not have access
I need to test functions which uses datetime.datetime.now(). What is the easiest way to do this?
I am looking for a way to be able to mock location without needing to use ACCESS_MOCK_LOCATION. I know that I need to have root, move app to the system. But whe
I'm working on tests for a Symfony2 project, and right now I'm looking for a way to create tests involving entity objects without persisting them. The problem i