Пример #1
0
        public async Task FilterByDescAtc3()
        {
            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_atc3_code", Value = "a*"
                });
                string atcString = await autocom.GetAtc3(filters);

                Atc3[] atcs = JsonConvert.DeserializeObject <Atc3[]>(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 GetAtc3()
        {
            try
            {
                var watch = System.Diagnostics.Stopwatch.StartNew();

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

                Atc3[] atcs = JsonConvert.DeserializeObject <Atc3[]>(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);
            }
        }