public async void MakeAPICallToGetAllErrorsr() { var response = await APICallModel.APICallGetAll(); var tokens = JToken.Parse(response).ToString(); List <Error> errors = JsonConvert.DeserializeObject <List <Error> >(tokens); Assert.NotEmpty(errors); }
/// <summary> /// Action that makes a GET request to the API to get all available /// errors in reference /// </summary> /// <returns>ErrorViewModel</returns> public async Task <IActionResult> Index() { try { string errorResults = await APICallModel.APICallGetAll(); string tokens = JToken.Parse(errorResults).ToString(); var errorList = JsonConvert.DeserializeObject <List <Error> >(tokens); return(View(ErrorResultViewModel.AllDetails(errorList))); } catch (Exception) { return(NotFound()); } }