In the following test case, we arrange to test for the external API failure.
When a server error is returned from the Text Analytics API, our EvaluateText implementation presently fails with an exception, since the HTTP response content is not a valid JSON. The MSTest framework allows us to expect the exception using the ExpectedException attribute, and also to specify whether a specific exception type or any of the derived types are considered valid.
In the "arrange" section of the test, we will create a valid input string, and set up the SendAsync method in the HttpMessageHandler mockup class to return HttpStatusCode.InternalServerError.
In the "act" section, we will execute the