what is mock in unit testing


  • Mock is a method/object that simulates the behavior of a real method/object in controlled ways. 
  • Mock objects are used in unit testing
  • Often a method under a test calls other external services or methods within it. 
  • These are called dependencies.

No comments:

Post a Comment