public FractionUnboundAlternativeDTO MapFrom(ParameterAlternativeWithSpecies parameterAlternative) { var fractionUnbound = parameterAlternative.Parameter(CoreConstants.Parameters.FRACTION_UNBOUND_PLASMA_REFERENCE_VALUE); var fractionUnboundAlternativeDTO = new FractionUnboundAlternativeDTO(parameterAlternative, fractionUnbound.ValueOrigin); fractionUnboundAlternativeDTO.FractionUnboundParameter = _parameterDTOMapper.MapFrom(fractionUnbound, fractionUnboundAlternativeDTO, dto => dto.FractionUnbound, dto => dto.FractionUnboundParameter); return(fractionUnboundAlternativeDTO); }
protected override void Context() { base.Context(); _species = new Species(); var alternative = new ParameterAlternativeWithSpecies(); A.CallTo(() => _objectBaseFactory.Create <ParameterAlternativeWithSpecies>()).Returns(alternative); _compoundParameterGroup.Name = CoreConstants.Groups.COMPOUND_FRACTION_UNBOUND; A.CallTo(() => _speciesRepository.DefaultSpecies).Returns(_species); }
public FractionUnboundAlternativeDTO MapFrom(ParameterAlternativeWithSpecies parameterAlternative) { var fractionUnboundAlternativeDTO = new FractionUnboundAlternativeDTO(parameterAlternative); var lipophilicity = parameterAlternative.Parameter(CoreConstants.Parameter.FractionUnbound); fractionUnboundAlternativeDTO.FractionUnboundParameter = _parameterDTOMapper.MapFrom(lipophilicity, fractionUnboundAlternativeDTO, dto => dto.FractionUnbound, dto => dto.FractionUnboundParameter); return(fractionUnboundAlternativeDTO); }
protected override async Task Context() { await base.Context(); _snapshot = await sut.MapToSnapshot(_alternativeWithSpecies); var newAlternativeWithSpecies = new ParameterAlternativeWithSpecies(); A.CallTo(() => _parameterAlternativeFactory.CreateAlternativeFor(_parameterGroup)).Returns(newAlternativeWithSpecies); _snapshotParameter = new Parameter { Name = "P1" }; _alternativeParameter = DomainHelperForSpecs.ConstantParameterWithValue(1).WithName(_snapshotParameter.Name); newAlternativeWithSpecies.Add(_alternativeParameter); _snapshot.Parameters = new[] { _snapshotParameter }; }
protected override Task Context() { _parameterMapper = A.Fake <ParameterMapper>(); _parameterAlternativeFactory = A.Fake <IParameterAlternativeFactory>(); _speciesRepository = A.Fake <ISpeciesRepository>(); _compoundAlternativeTask = A.Fake <ICompoundAlternativeTask>(); sut = new AlternativeMapper(_parameterMapper, _parameterAlternativeFactory, _compoundAlternativeTask, _speciesRepository); _parameterGroup = new ParameterAlternativeGroup { Name = "ParameterGroup" }; _alternative = new ParameterAlternative { Name = "Alternative1", IsDefault = true, Description = "Hello" }; _species = new Species { Name = "Hello" }; _alternativeWithSpecies = new ParameterAlternativeWithSpecies { Name = "Alternative2", IsDefault = false, Description = "Hello", Species = _species }; _parameterGroup.AddAlternative(_alternativeWithSpecies); A.CallTo(() => _speciesRepository.All()).Returns(new[] { _species }); return(_completed); }
public FractionUnboundAlternativeDTO(ParameterAlternativeWithSpecies parameterAlternative, ValueOrigin valueOrigin) : base(parameterAlternative, valueOrigin) { ParameterAlternative = parameterAlternative; }
protected override async Task Because() { _newAlternativeWithSpecies = await sut.MapToModel(_snapshot, _parameterGroup) as ParameterAlternativeWithSpecies; }
public FractionUnboundAlternativeDTO(ParameterAlternativeWithSpecies parameterAlternative) : base(parameterAlternative) { ParameterAlternative = parameterAlternative; }
public ICommand SetSpeciesForAlternative(ParameterAlternativeWithSpecies parameterAlternative, Species species) { return(new SetSpeciesInSpeciesDependentEntityCommand(parameterAlternative, species, _executionContext).Run(_executionContext)); }
protected override async Task Because() { _newAlternativeWithSpecies = await sut.MapToModel(_snapshot, new AlternativeMapperSnapshotContext(_parameterGroup, new SnapshotContext())) as ParameterAlternativeWithSpecies; }