protected override void Context()
 {
     base.Context();
     _interactionProperties = new InteractionProperties();
     _compoundProperties    = new CompoundProperties();
     _compoundProperties.AddCompoundGroupSelection(new CompoundGroupSelection {
         AlternativeName = _alternativeLipo1.Name, GroupName = CoreConstants.Groups.COMPOUND_LIPOPHILICITY
     });
     _compoundProperties.AddCompoundGroupSelection(new CompoundGroupSelection {
         AlternativeName = _alternativePerm2.Name, GroupName = CoreConstants.Groups.COMPOUND_PERMEABILITY
     });
 }
        protected override void Context()
        {
            base.Context();
            _updateTableFormulaCommand        = A.Fake <ICommand>();
            _editedTableFormula               = new TableFormula();
            _editSolubilityParameterPresenter = A.Fake <IEditTableSolubilityParameterPresenter>();
            _parameter = DomainHelperForSpecs.ConstantParameterWithValue().WithName("SOL");
            A.CallTo(() => _applicationController.Start <IEditTableSolubilityParameterPresenter>()).Returns(_editSolubilityParameterPresenter);

            A.CallTo(() => _editSolubilityParameterPresenter.Edit(_parameter)).Returns(true);
            A.CallTo(() => _editSolubilityParameterPresenter.EditedFormula).Returns(_editedTableFormula);

            A.CallTo(() => _parameterTask.UpdateTableFormula(_parameter, _editedTableFormula)).Returns(_updateTableFormulaCommand);


            var solGroup = new ParameterAlternativeGroup().WithName(CoreConstants.Groups.COMPOUND_SOLUBILITY);

            _alternative = new ParameterAlternative().WithName("ALT1");
            _alternative.Add(_parameter);
            solGroup.AddAlternative(_alternative);
            var simulation = new IndividualSimulation {
                Properties = new SimulationProperties()
            };

            A.CallTo(() => _buildingBlockRepository.All <Simulation>()).Returns(new[] { simulation });

            var compoundProperties = new CompoundProperties();

            simulation.Properties.AddCompoundProperties(compoundProperties);
            compoundProperties.AddCompoundGroupSelection(new CompoundGroupSelection {
                AlternativeName = _alternative.Name, GroupName = solGroup.Name
            });
        }
Example #3
0
 public void SaveConfiguration()
 {
     _compoundProperties.ClearGroupMapping();
     _parameterMappingDTO.SelectedAlternatives().Each(
         alternative => _compoundProperties.AddCompoundGroupSelection(new CompoundGroupSelection
     {
         GroupName       = alternative.GroupName,
         AlternativeName = alternative.Name
     }));
 }
        protected override void Context()
        {
            base.Context();
            var lipoGroup = new ParameterAlternativeGroup().WithName(CoreConstants.Groups.COMPOUND_LIPOPHILICITY);

            _alternative            = new ParameterAlternative().WithName("ALT1");
            _parameterInAlternative = DomainHelperForSpecs.ConstantParameterWithValue(1).WithName(CoreConstants.Parameters.LIPOPHILICITY);
            _alternative.Add(_parameterInAlternative);
            lipoGroup.AddAlternative(_alternative);
            var simulation = new IndividualSimulation {
                Properties = new SimulationProperties()
            };

            A.CallTo(() => _buildingBlockRepository.All <Simulation>()).Returns(new[] { simulation });

            var compoundProperties = new CompoundProperties();

            simulation.Properties.AddCompoundProperties(compoundProperties);
            compoundProperties.AddCompoundGroupSelection(new CompoundGroupSelection {
                AlternativeName = _alternative.Name, GroupName = lipoGroup.Name
            });
        }
        protected override void Context()
        {
            base.Context();

            _parameter1           = DomainHelperForSpecs.ConstantParameterWithValue(10).WithName("P1");
            _parameter1.IsDefault = false;
            _parameter2           = DomainHelperForSpecs.ConstantParameterWithValue(10).WithName("P2");
            _parameter2.IsDefault = true;
            _parameter3           = DomainHelperForSpecs.ConstantParameterWithValue(10).WithName("P3");
            _parameter3.IsDefault = false;

            var alternativeGroup = new ParameterAlternativeGroup().WithName("Gr");

            _parameterAlternative = new ParameterAlternative {
                _parameter1, _parameter2, _parameter3
            };
            _parameterAlternative.Name = "Alt";
            alternativeGroup.AddAlternative(_parameterAlternative);

            _newValueOrigin = new ValueOrigin
            {
                Method = ValueOriginDeterminationMethods.InVivo,
                Source = ValueOriginSources.Database
            };

            var simulation = new IndividualSimulation {
                Properties = new SimulationProperties()
            };

            A.CallTo(() => _buildingBlockRepository.All <Simulation>()).Returns(new[] { simulation });

            var compoundProperties = new CompoundProperties();

            simulation.Properties.AddCompoundProperties(compoundProperties);
            compoundProperties.AddCompoundGroupSelection(new CompoundGroupSelection {
                AlternativeName = _parameterAlternative.Name, GroupName = alternativeGroup.Name
            });
        }
Example #6
0
        public CompoundProperties MapFrom(Compound compound)
        {
            var compoundProperties = new CompoundProperties {
                Compound = compound
            };

            foreach (var category in _categoryRepository.All())
            {
                var compoundCalculationMethod = compound.CalculationMethodFor(category) ?? category.DefaultItem;
                compoundProperties.AddCalculationMethod(compoundCalculationMethod);
            }

            //update default mapping for alternatives in compound
            foreach (var alternativeGroup in compound.AllParameterAlternativeGroups())
            {
                var compoundGroupSelection = new CompoundGroupSelection {
                    AlternativeName = alternativeGroup.DefaultAlternative.Name, GroupName = alternativeGroup.Name
                };
                compoundProperties.AddCompoundGroupSelection(compoundGroupSelection);
            }

            return(compoundProperties);
        }
 public void should_add_one_compound_parameter_selection_for_each_selected_alternative()
 {
     //one for each process
     A.CallTo(() => _compoundProperties.AddCompoundGroupSelection(A <CompoundGroupSelection> .Ignored)).MustHaveHappened(Repeated.Exactly.Twice);
 }