Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Mocking the inner methods didn't work, while calling original method inner methods are being called irrespective of mock

What I have tried:

I have one method and that has 2 inner methods that are being called based on condition. The inner methods are returning strings and i have mocked those methods to return strings. While main method is being called the mocking of inner methods didn't work and called the original methods. Why the mocked strings not returned here?
Posted
Comments
Richard Deeming 12-Feb-24 4:27am    
Nobody can help you. We have no access to your code, so we can't even begin to guess what you've done wrong.

Click the green "Improve question" link and update your question to include the relevant parts of your code.

1 solution

This is an impossible question for anyone but you to answer right now. When you post a question, you have to ask yourself, "if I cannot see my code, would there be enough detail and information for me to be able to answer the question?"

Provide a sample of the code that doesn't work. Be prepared to expand your question as people as for clarifications. Without this level of detail, and commitment to working with us, you can expect that no one will be able to give you an answer that will solve the issue you are facing.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900