public async Task <ActionResult> GetInventory(int id) { var models = new Inventorypass(); using (var httpClient = new HttpClient()) { HttpRequestMessage request = CreateRequestToService(HttpMethod.Get, Configuration["ServiceEndpoints:AccountCharacter"] + "/Inventory/" + id.ToString()); var Response = await httpClient.SendAsync(request); if (Response.IsSuccessStatusCode) { var jsonString = await Response.Content.ReadAsStringAsync(); List <Item> items = JsonConvert.DeserializeObject <List <Item> >(jsonString); var viewmodel = new Inventorypass() { items = items, charID = id }; return(View(viewmodel)); } } return(View(models)); }
public void InvPassPass() { var invpass = new Inventorypass() { charID = 1 }; Assert.Equal(1, invpass.charID); }