Ejemplo n.º 1
0
        public async Task FilterByDescMolecule()
        {
            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 = "Description", Value = "*"
                });
                string moleculeString = await autocom.GetMolecule(filters);

                Molecule[] molecules = JsonConvert.DeserializeObject <Molecule[]>(moleculeString);

                watch.Stop();


                Assert.IsNotNull(molecules);

                Assert.IsTrue(molecules.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 GetMolecule()
        {
            try
            {
                var watch = System.Diagnostics.Stopwatch.StartNew();

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

                string moleculeString = await autocom.GetMolecule(null);

                Molecule[] molecules = JsonConvert.DeserializeObject <Molecule[]>(moleculeString);

                watch.Stop();

                Assert.IsNotNull(molecules);

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