Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [TestMethod]
- public void GetCSRInfo_BadOperation_ThrowsExceptionAndIsHandled()
- {
- // Arrange
- var uscAPI = RestService.For<IUscApi>(_uscapiurl);
- string csrCode = "404";
- // Act
- try
- {
- CsrInfo item = uscAPI.GetCSRInfo(csrCode).Result.FirstOrDefault();
- }
- catch (AggregateException ae)
- {
- ae.Handle((x) =>
- {
- Debug.WriteLine("There was a problem getting the CSR information: " + x.Message);
- // Assert
- Assert.IsTrue(x is ApiException);
- return true;
- });
- }
- }
Add Comment
Please, Sign In to add comment