protected override void Context()
        {
            base.Context();
            var ontogeny1 = new DatabaseOntogeny {
                SpeciesName = "Dog", Name = "CYP3A1"
            };
            var ontogeny2 = new DatabaseOntogeny {
                SpeciesName = "Dog", Name = "CYP3A2"
            };
            var ontogeny3 = new DatabaseOntogeny {
                SpeciesName = "Dog", Name = "CYP3A3"
            };

            _originData = new OriginData {
                Species = new Species {
                    Name = "Dog"
                }
            };
            A.CallTo(() => _ontogenyRepository.AllFor(_originData.Species.Name)).Returns(new[] { ontogeny1, ontogeny2, ontogeny3 });
            A.CallTo(() => _ontogenyRepository.OntogenyFactorFor(ontogeny1, CoreConstants.Groups.ONTOGENY_LIVER, _originData, null)).Returns(0.1);
            A.CallTo(() => _ontogenyRepository.OntogenyFactorFor(ontogeny2, CoreConstants.Groups.ONTOGENY_DUODENUM, _originData, null)).Returns(0.22);
            A.CallTo(() => _ontogenyRepository.OntogenyFactorFor(ontogeny2, CoreConstants.Groups.ONTOGENY_LIVER, _originData, null)).Returns(0.21);
            A.CallTo(() => _ontogenyRepository.OntogenyFactorFor(ontogeny3, CoreConstants.Groups.ONTOGENY_LIVER, _originData, null)).Returns(0.31);

            _moleculeNames.Add(new MoleculeOntogeny("CYP1", "CYP3A1"));
            _moleculeNames.Add(new MoleculeOntogeny("CYP2", "CYP3A2"));
            _moleculeNames.Add(new MoleculeOntogeny("CYP3", "CYP3A3"));
            _moleculeNames.Add(new MoleculeOntogeny("CYP4", "ENZYME_NOT_FOUND"));
        }
Exemple #2
0
        protected override async Task Context()
        {
            await base.Context();

            _ontogeny = new DatabaseOntogeny
            {
                Name        = "Database",
                Description = "Database description"
            };
        }
        public void should_retrieve_new_agp_ontogeny()
        {
            var ontogenyRepo = IoC.Resolve <IOntogenyRepository>();
            var ontogeny     = new DatabaseOntogeny {
                Name = CoreConstants.Molecule.AGP, SpeciesName = CoreConstants.Species.HUMAN
            };

            var agpOntogenies = ontogenyRepo.AllValuesFor(ontogeny).OrderBy(onto => onto.PostmenstrualAge).ToArray();

            agpOntogenies.Length.ShouldBeEqualTo(19);

            agpOntogenies[0].PostmenstrualAge.ShouldBeEqualTo(0.76, 1e-2);
            agpOntogenies[agpOntogenies.Length - 1].PostmenstrualAge.ShouldBeEqualTo(90.45, 1e-2);

            foreach (var agpOntogeny in agpOntogenies)
            {
                agpOntogeny.Deviation.ShouldBeGreaterThan(1.44);
                agpOntogeny.Deviation.ShouldBeSmallerThan(1.89);
            }
        }