protected override void Context() { _individual = DomainHelperForSpecs.CreateIndividual(); _representationInfoRep = A.Fake <IRepresentationInfoRepository>(); _quantityPathMapper = A.Fake <IQuantityPathToQuantityDisplayPathMapper>(); sut = new FullPathDisplayResolver(_representationInfoRep, _quantityPathMapper); }
protected override void Context() { _view = A.Fake <IExpressionProfileSelectionView>(); _moleculePropertiesMapper = A.Fake <IMoleculePropertiesMapper>(); _buildingBlockRepository = A.Fake <IBuildingBlockRepository>(); _expressionProfileTask = A.Fake <IExpressionProfileTask>(); sut = new ExpressionProfileSelectionPresenter(_view, _moleculePropertiesMapper, _buildingBlockRepository, _expressionProfileTask); A.CallTo(() => _view.BindTo(A <ExpressionProfileSelectionDTO> ._)) .Invokes(x => _dto = x.GetArgument <ExpressionProfileSelectionDTO>(0)); _individual = DomainHelperForSpecs.CreateIndividual(speciesName: "Human"); _expressionProfile1 = DomainHelperForSpecs.CreateExpressionProfile <IndividualEnzyme>(speciesName: "Human"); _expressionProfile2 = DomainHelperForSpecs.CreateExpressionProfile <IndividualEnzyme>(speciesName: "Human"); _expressionProfile3 = DomainHelperForSpecs.CreateExpressionProfile <IndividualTransporter>(speciesName: "Human"); _expressionProfile4 = DomainHelperForSpecs.CreateExpressionProfile <IndividualEnzyme>(speciesName: "Dog"); _expressionProfile5 = DomainHelperForSpecs.CreateExpressionProfile <IndividualEnzyme>(speciesName: "Human"); _allExpressionProfiles = new List <ExpressionProfile> { _expressionProfile1, _expressionProfile2 }; A.CallTo(() => _buildingBlockRepository.All(A <Func <ExpressionProfile, bool> > ._)) .Invokes(x => _predicate = x.GetArgument <Func <ExpressionProfile, bool> >(0)) .Returns(_allExpressionProfiles); _individual.AddExpressionProfile(_expressionProfile5); }
public override void GlobalContext() { base.GlobalContext(); _withIdRepository = IoC.Resolve <IWithIdRepository>(); _simulation = new IndividualSimulation().WithId("Sim"); _simulation.IsLoaded = true; _withIdRepository.Register(_simulation); _simulation.AddUsedBuildingBlock(new UsedBuildingBlock("Ind", PKSimBuildingBlockType.Individual) { BuildingBlock = DomainHelperForSpecs.CreateIndividual() }); _transporter = new IndividualTransporter().WithName("Trans"); _enzyme = new IndividualEnzyme().WithName("Enz"); _simulation.Individual.AddMolecule(_transporter); _simulation.Individual.AddMolecule(_enzyme); }
protected override void Context() { _view = A.Fake <ISimpleProtocolView>(); _schemaDTOMapper = A.Fake <ISchemaToSchemaDTOMapper>(); _protocolTask = A.Fake <IProtocolTask>(); _parameterTask = A.Fake <IParameterTask>(); _individualFactory = A.Fake <IIndividualFactory>(); _representationInfoRepository = A.Fake <IRepresentationInfoRepository>(); _dynamicParameterPresenter = A.Fake <IMultiParameterEditPresenter>(); _simpleProtocolToSimpleProtocolDTOMapper = A.Fake <ISimpleProtocolToSimpleProtocolDTOMapper>(); _individual = DomainHelperForSpecs.CreateIndividual(); A.CallTo(() => _individualFactory.CreateParameterLessIndividual()).Returns(_individual); sut = new SimpleProtocolPresenter(_view, _dynamicParameterPresenter, _simpleProtocolToSimpleProtocolDTOMapper, _protocolTask, _parameterTask, _individualFactory, _representationInfoRepository); sut.InitializeWith(A.Fake <ICommandCollector>()); }
protected RandomPopulation CreateRandomPopulation() { var pop = new RandomPopulation(); pop.Settings = new RandomPopulationSettings(); var cache = new PathCache <IParameter>(_entityPathResolver); cache.Add("PATH1", DomainHelperForSpecs.ConstantParameterWithValue(4).WithName("PARA1")); cache.Add("PATH2", DomainHelperForSpecs.ConstantParameterWithValue(5).WithName("PARA2")); pop.IndividualPropertiesCache.ParameterValuesCache.Add(new[] { new ParameterValue("PATH1", 1, 0.1), new ParameterValue("PATH2", 2, 0.2) }); pop.IndividualPropertiesCache.ParameterValuesCache.Add(new[] { new ParameterValue("PATH1", 11, 0.11), new ParameterValue("PATH2", 11, 0.22) }); pop.Settings.BaseIndividual = DomainHelperForSpecs.CreateIndividual(); A.CallTo(() => _containerTask.CacheAllChildren <IParameter>(pop.Settings.BaseIndividual)).Returns(cache); return(pop); }