public async Task return_newconfirmed_single_value() { var mockHttp = new MockHttpMessageHandler(); //setup mock test mockHttp.When("https://api.covid19api.com/summary") .Respond("application/json", "{ 'Global': { 'NewConfirmed': '100'}} "); // respond with 100 var client = mockHttp.ToHttpClient(); var apiservice = new CovidService(client); var user = await apiservice.GetSummary <ApiRootObject>(); user.Global.NewConfirmed.ShouldBe(100); }