Exemple #1
0
        public async Task FilterByDescNec3()
        {
            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_nec3_code", Value = "0*"
                });
                string necString = await autocom.GetNec3(filters);

                Nec3[] necs = JsonConvert.DeserializeObject <Nec3[]>(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);
            }
        }
Exemple #2
0
        public async Task GetNec3()
        {
            try
            {
                var watch = System.Diagnostics.Stopwatch.StartNew();

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

                string necString = await autocom.GetNec3(null);

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