Ejemplo n.º 1
0
        public async Task FilterByDescProduct()
        {
            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 = "Product", Value = "*"
                });
                string productString = await autocom.GetProduct(filters);

                Product[] products = JsonConvert.DeserializeObject <Product[]>(productString);

                watch.Stop();


                Assert.IsNotNull(products);

                Assert.IsTrue(products.Count() > 0);

                ////Assert.IsTrue(atcs.ElementAt(0).ATC1_Code == "A");

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

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

                string productString = await autocom.GetProduct(null);

                Product[] products = JsonConvert.DeserializeObject <Product[]>(productString);

                watch.Stop();

                Assert.IsNotNull(products);

                Assert.IsTrue(products.Count() > 0);

                ////Assert.IsTrue(atcs.ElementAt(0).ATC1_Code == "A");

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