public void GetAllBranches_calls_client_with_correct_url() { // Arrange _webApiClient.Get <ApiResponse <IList <BranchDTO> > >(Arg.Any <string>()).ReturnsNull(); // Act _client.GetAllBranches(); // Assert _webApiClient.Received(1).Get <ApiResponse <IList <BranchDTO> > >(Arg.Is("branches")); }
/// <summary> /// Get all branches from service /// </summary> /// <returns></returns> public IList <BranchDTO> GetAllBranches() { try { var apiResponse = _webApiClient.Get <ApiResponse <IList <BranchDTO> > >(Urls.Branches); return(apiResponse.Data); } catch (Exception exception) { _logger.Error(exception); return(new List <BranchDTO>()); } }