protected override void Context()
        {
            _speciesRepository        = A.Fake <ISpeciesRepository>();
            _usedMoleculeRepository   = A.Fake <IUsedMoleculeRepository>();
            _projectRetriever         = A.Fake <IPKSimProjectRetriever>();
            _moleculePropertiesMapper = A.Fake <IMoleculePropertiesMapper>();
            _usedExpressionProfileCategoryRepository = A.Fake <IUsedExpressionProfileCategoryRepository>();
            sut = new ExpressionProfileToExpressionProfileDTOMapper(
                _speciesRepository,
                _usedMoleculeRepository,
                _projectRetriever,
                _moleculePropertiesMapper,
                _usedExpressionProfileCategoryRepository);

            A.CallTo(() => _usedMoleculeRepository.All()).Returns(new[] { "A", "B" });
            A.CallTo(() => _usedExpressionProfileCategoryRepository.All()).Returns(new[] { "CatA", "CatB" });
            A.CallTo(() => _speciesRepository.All()).Returns(new[] { new Species {
                                                                         Name = "Human"
                                                                     }, new Species {
                                                                         Name = "Rat"
                                                                     } });

            _expressionProfile1 = DomainHelperForSpecs.CreateExpressionProfile <IndividualEnzyme>("DOG", "CYP3A4", "Sick");

            A.CallTo(() => _projectRetriever.Current.All <ExpressionProfile>()).Returns(new[] { _expressionProfile1 });
        }
Example #2
0
 protected CreatePartialProcessPresenter(TView view,
                                         ICompoundProcessTask compoundProcessTask,
                                         IPartialProcessToPartialProcessDTOMapper partialProcessMapper,
                                         IParametersByGroupPresenter parameterEditPresenter,
                                         ICompoundProcessToCompoundProcessDTOMapper processMapper,
                                         IUsedMoleculeRepository usedMoleculeRepository, ISpeciesRepository speciesRepository)
     : base(view, parameterEditPresenter, processMapper, compoundProcessTask, speciesRepository)
 {
     _partialProcessMapper      = partialProcessMapper;
     _view.AllAvailableProteins = usedMoleculeRepository.All();
     DefaultMoleculeName        = string.Empty;
 }
Example #3
0
        public ExpressionProfileDTO MapFrom(ExpressionProfile expressionProfile)
        {
            var dto = new ExpressionProfileDTO
            {
                Icon          = _moleculePropertiesMapper.MoleculeIconFor(expressionProfile.Molecule),
                Species       = expressionProfile.Species,
                Category      = expressionProfile.Category,
                MoleculeName  = moleculeNameFor(expressionProfile),
                AllMolecules  = _usedMoleculeRepository.All(),
                AllCategories = _usedExpressionProfileCategoryRepository.All(),
                AllSpecies    = _speciesRepository.All(),
                MoleculeType  = _moleculePropertiesMapper.MoleculeDisplayFor(expressionProfile.Molecule),
            };

            dto.AddExistingExpressionProfileNames(_projectRetriever.Current.All <ExpressionProfile>().AllNames().Except(new[] { expressionProfile.Name }));
            return(dto);
        }
Example #4
0
 public SimpleMoleculePresenter(ISimpleMoleculeView view, IObjectTypeResolver objectTypeResolver, IUsedMoleculeRepository usedMoleculeRepository)
     : base(view, false)
 {
     _objectTypeResolver    = objectTypeResolver;
     view.AvailableProteins = usedMoleculeRepository.All();
 }