Exemplo 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);
            }
        }
Exemplo 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);
            }
        }
Exemplo n.º 3
0
        public async Task GetNec4WithFilter()
        {
            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 = "NEC4_Code", Value = "0*"
                });
                string necString = await autocom.GetNec4(filters);

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

                watch.Stop();

                Assert.IsNotNull(necs);

                Assert.IsTrue(necs.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);
            }
        }
Exemplo n.º 4
0
        public async Task FilterByDescAtc4()
        {
            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_atc4_code", Value = "a*"
                });
                string atcString = await autocom.GetAtc4(filters);

                Atc4[] atcs = JsonConvert.DeserializeObject <Atc4[]>(atcString);

                watch.Stop();

                Assert.IsNotNull(atcs);
                Assert.IsTrue(atcs.Count() > 0);
                var elapsedMs = watch.ElapsedMilliseconds;
                Assert.IsTrue(elapsedMs < 5000);
            }
            catch (Exception exc)
            {
                Assert.Fail(exc.Message);
            }
        }
Exemplo n.º 5
0
        public void GetAtc()
        {
            try
            {
                var watch = System.Diagnostics.Stopwatch.StartNew();

                API.Controllers.AutocompleteController autocom = new API.Controllers.AutocompleteController();
                string atcString = autocom.GetAtc(null);
                Atc[]  atcs      = JsonConvert.DeserializeObject <Atc[]>(atcString);

                watch.Stop();

                Assert.IsNotNull(atcs);
                Assert.IsTrue(atcs.Count() > 0);
                var elapsedMs = watch.ElapsedMilliseconds;
                Assert.IsTrue(elapsedMs < 6000);
            }
            catch (Exception exc)
            {
                Assert.Fail(exc.Message);
            }
        }
Exemplo n.º 6
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);
            }
        }