Beispiel #1
0
        public async Task GetManufacturerWithFilter()
        {
            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 = "Manufacturer", Value = "3*"
                });
                string manufacturerString = await autocom.GetManufacturer(filters);

                Manufacturer[] manufacturers = JsonConvert.DeserializeObject <Manufacturer[]>(manufacturerString);

                watch.Stop();

                Assert.IsNotNull(manufacturers);

                Assert.IsTrue(manufacturers.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);
            }
        }
Beispiel #2
0
        public async Task GetManufacturer()
        {
            try
            {
                var watch = System.Diagnostics.Stopwatch.StartNew();

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

                string manufacturerString = await autocom.GetManufacturer(null);

                Manufacturer[] manufacturer = JsonConvert.DeserializeObject <Manufacturer[]>(manufacturerString);

                watch.Stop();

                Assert.IsNotNull(manufacturer);

                Assert.IsTrue(manufacturer.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);
            }
        }