コード例 #1
0
        public async Task ListStatusAsync()
        {
            try
            {
                var data = await _ICovidLogic.GetCovid19CasesAsync();

                foreach (var item in data)
                {
                    foreach (var entityProp in data.GetType().GetProperties())
                    {
                        var entityValue = entityProp.GetValue(item);

                        if (!string.IsNullOrEmpty(entityValue as string))
                        {
                            var result = $"{entityProp.Name}: {entityValue}";
                            Console.WriteLine(result);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
コード例 #2
0
        public async Task GetLatestsCovid19NumbersTestAsync()
        {
            var covid19Cases = await _ICovidLogic.GetCovid19CasesAsync();

            Assert.AreNotEqual("No Content", covid19Cases);

            //Assert.(covid19Cases)
            //.As(new covid19Cases())
            //.Given(covid19Cases)
            //.When(covid19Cases)
            //.Then(covid19Cases);
        }
コード例 #3
0
        public async Task TestGetListOfDataAsync()
        {
            var data = await _ICovidLogic.GetCovid19CasesAsync();

            Assert.NotNull(data);
        }
コード例 #4
0
 public async Task <List <Covid19> > ListOfCovid19DataAsync()
 {
     return(await _iCoronaComponent.GetCovid19CasesAsync());
 }