Skip to main content
Became Hot Network Question
edited tags
Link
João Farias
  • 11k
  • 2
  • 20
  • 40
Source Link
Revils
  • 119
  • 1

Unit Test - Testing API Methods

I was reading the following article

Unit testing an API

This article is about unit testing an API and the methods on a class through the interface. What I do not seem to grasp is the fact that in my idea you would want to test the method implementation / functionality of the 'real' methods?

So If I implement the method 'GetById', I would want to test the functionality of that function. However the Article shows how to create a Fake and test the Fake implementation of 'GetById'. This way you have two different definitions and testing just a 'totally different method / piece of code' and not the implementation / code you would like to see tested in the first place?

Maybe I am missing the point of unit tests here?