User1120430333 posted
https://www.artima.com/weblogs/viewpost.jsp?thread=126923
<copied>
•It talks to the database
•It communicates across the network
•It touches the file system
•It can't run at the same time as any of your other unit tests
•You have to do special things to your environment (such as editing config files) to run it.
<end>
You need to mock out the call to an external source, like a call to a Rest Url. But can you do it from a controller that is making a direct call to the external source? That's probably going to be a no. However, you could mock out the call to a Repository
that made the call to the RestUrl on the behalf of the controller that called the Repository.
https://msdn.microsoft.com/en-us/library/ff650441.aspx
<copied>
Mock objects are instances of test-provided classes that simulate the behavior of external components. Mock objects isolate the application code under test.
<end>
https://msdn.microsoft.com/en-us/library/ff649690.aspx
<copied>
It centralizes the data logic or Web service access logic.
It provides a substitution point for the unit tests.
<end>