Exemplo n.º 1
0
        public async Task FilterByDescNec1()
        {
            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_nec1_code", Value = "0*"
                });
                string necString = await autocom.GetNec1(filters);

                Nec1[] necs = JsonConvert.DeserializeObject <Nec1[]>(necString);

                watch.Stop();

                Assert.IsNotNull(necs);
                Assert.IsTrue(necs.Count() > 0);
                var elapsedMs = watch.ElapsedMilliseconds;
                Assert.IsTrue(elapsedMs < 5000);
            }
            catch (Exception exc)
            {
                Assert.Fail(exc.Message);
            }
        }
Exemplo n.º 2
0
        public async Task GetNec1()
        {
            try
            {
                var watch = System.Diagnostics.Stopwatch.StartNew();

                API.Controllers.AutocompleteController autocom = new API.Controllers.AutocompleteController();

                string atcString = await autocom.GetNec1(null);

                Nec1[] necs = JsonConvert.DeserializeObject <Nec1[]>(atcString);

                watch.Stop();

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