Am writing unit test cases (MSTest) for a webAPI method.
- Do I have to directly create a new instance of the controller and call the webAPI method to obtain the response? & then keep an Assert statement to check if the value inside the response matches with a value? or
- Do I have to create an interface for the controller and then mock the controller class and the input values and call the webAPI method to obtain the response? & then keep an Assert statement to check if the value inside the response matches with a value?
If so how to create an interface of the controller and create mock of the same? (ex: controller name: ABCController , API Method to call : ABCGet() )