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);
        }
Esempio n. 2
0
 protected override void Context()
 {
     base.Context();
     _expressionProfile = DomainHelperForSpecs.CreateExpressionProfile <IndividualEnzyme>();
     _individual        = DomainHelperForSpecs.CreateIndividual();
     _individual.AddExpressionProfile(_expressionProfile);
     _usedBuildingBlock = new UsedBuildingBlock(_expressionProfile.Id, _expressionProfile.BuildingBlockType);
     _simulation1.AddUsedBuildingBlock(_usedBuildingBlock);
     A.CallTo(() => _buildingBlockRepository.All(A <Func <ISimulationSubject, bool> > ._))
     .Returns(new[] { _individual });
 }
        protected override void Context()
        {
            _sourceIndividual             = DomainHelperForSpecs.CreateIndividual();
            _targetIndividual             = DomainHelperForSpecs.CreateIndividual();
            _expressionProfile1           = new ExpressionProfile();
            _targetIndividualOtherSpecies = DomainHelperForSpecs.CreateIndividual(speciesName: "OTHER_SPECIES");
            _moleculeExpressionTask       = A.Fake <IMoleculeExpressionTask <Individual> >();
            _dialogCreator = A.Fake <IDialogCreator>();
            sut            = new IndividualExpressionsUpdater(_moleculeExpressionTask, _dialogCreator);

            _sourceIndividual.AddExpressionProfile(_expressionProfile1);
        }