예제 #1
0
        public async Task FilterByDescAtc4()
        {
            try
            {
                var watch = System.Diagnostics.Stopwatch.StartNew();

                API.Controllers.AutocompleteController autocom = new API.Controllers.AutocompleteController();
                List <Filter> filters = new List <Filter>();
                filters.Add(new Filter()
                {
                    Condition = "add", Criteria = "S_atc4_code", Value = "a*"
                });
                string atcString = await autocom.GetAtc4(filters);

                Atc4[] atcs = JsonConvert.DeserializeObject <Atc4[]>(atcString);

                watch.Stop();

                Assert.IsNotNull(atcs);
                Assert.IsTrue(atcs.Count() > 0);
                var elapsedMs = watch.ElapsedMilliseconds;
                Assert.IsTrue(elapsedMs < 5000);
            }
            catch (Exception exc)
            {
                Assert.Fail(exc.Message);
            }
        }
예제 #2
0
        public async Task GetAtc4()
        {
            try
            {
                var watch = System.Diagnostics.Stopwatch.StartNew();

                API.Controllers.AutocompleteController autocom = new API.Controllers.AutocompleteController();
                string atcString = await autocom.GetAtc4(null);

                Atc4[] atcs = JsonConvert.DeserializeObject <Atc4[]>(atcString);

                watch.Stop();

                Assert.IsNotNull(atcs);
                Assert.IsTrue(atcs.Count() > 0);
                var elapsedMs = watch.ElapsedMilliseconds;
                Assert.IsTrue(elapsedMs < 5000);
            }
            catch (Exception exc)
            {
                Assert.Fail(exc.Message);
            }
        }