protected override async Task Context()
        {
            await base.Context();

            _snapshot = await sut.MapToSnapshot(_enzymaticProcess);

            _templateProcess = new EnzymaticProcessWithSpecies();
            A.CallTo(() => _compoundProcessRepository.ProcessByName(_snapshot.InternalName)).Returns(_templateProcess);
            A.CallTo(() => _cloner.Clone((Model.CompoundProcess)_templateProcess)).Returns(_templateProcess);


            _snapshot.Molecule   = "CYP3A4";
            _snapshot.DataSource = "Lab";
            _snapshot.Species    = "Human";
            _species             = new Species {
                Name = _snapshot.Species
            };
            A.CallTo(() => _speciesRepository.All()).Returns(new[] { _species });
        }
        protected override void Context()
        {
            _executionContext = A.Fake <IExecutionContext>();
            _compoundProcess  = new EnzymaticProcessWithSpecies {
                InternalName = "CompoundProcess"
            };
            _species = new Species {
                Name = "NEW_SPECIES"
            };
            _compoundProcess.Species = new Species {
                Name = "OLD_SPECIES"
            };
            sut = new SetSpeciesInCompoundProcessCommand(_compoundProcess, _species);

            _defaultIndividualRetriever = A.Fake <IDefaultIndividualRetriever>();
            A.CallTo(() => _executionContext.Resolve <IDefaultIndividualRetriever>()).Returns(_defaultIndividualRetriever);

            _parameterMappingRepository = A.Fake <ICompoundProcessParameterMappingRepository>();
            A.CallTo(() => _executionContext.Resolve <ICompoundProcessParameterMappingRepository>()).Returns(_parameterMappingRepository);

            _individualParameter = DomainHelperForSpecs.ConstantParameterWithValue(value: 25).WithName("Matching");
            _individualParameter.ValueOrigin.Method = ValueOriginDeterminationMethods.Assumption;
            _individualParameter.ValueOrigin.Source = ValueOriginSources.ParameterIdentification;

            _organism = new Organism {
                _individualParameter
            };
            _individual = new Individual {
                Root = new RootContainer {
                    _organism
                }
            };

            A.CallTo(() => _defaultIndividualRetriever.DefaultIndividualFor(_species)).Returns(_individual);
            _matchingIndividualParameter    = DomainHelperForSpecs.ConstantParameterWithValue(isDefault: true).WithName("Matching");
            _nonMatchingIndividualParameter = DomainHelperForSpecs.ConstantParameterWithValue(isDefault: true).WithName("NonMatching");
            _compoundProcess.Add(_matchingIndividualParameter);
            _compoundProcess.Add(_nonMatchingIndividualParameter);

            _objectPath = new ObjectPath(_organism.Name, _individualParameter.Name);
            A.CallTo(() => _parameterMappingRepository.HasMappedParameterFor(_compoundProcess.InternalName, _matchingIndividualParameter.Name)).Returns(true);
            A.CallTo(() => _parameterMappingRepository.MappedParameterPathFor(_compoundProcess.InternalName, _matchingIndividualParameter.Name)).Returns(_objectPath);
        }
        protected override Task Context()
        {
            _parameterMapper = A.Fake <ParameterMapper>();
            _representationInfoRepository = A.Fake <IRepresentationInfoRepository>();
            _compoundProcessRepository    = A.Fake <ICompoundProcessRepository>();
            _cloner              = A.Fake <ICloner>();
            _speciesRepository   = A.Fake <ISpeciesRepository>();
            _compoundProcessTask = A.Fake <ICompoundProcessTask>();
            _logger              = A.Fake <IOSPSuiteLogger>();


            sut = new CompoundProcessMapper(_parameterMapper, _representationInfoRepository, _compoundProcessRepository, _cloner, _speciesRepository, _compoundProcessTask, _logger);

            _enzymaticProcess = new EnzymaticProcess
            {
                Name           = "Enzymatic Process",
                Description    = "Process description",
                InternalName   = "A",
                DataSource     = "B",
                MetaboliteName = "Meta"
            };

            //Same description as DB
            A.CallTo(() => _representationInfoRepository.DescriptionFor(RepresentationObjectType.PROCESS, _enzymaticProcess.InternalName)).Returns(_enzymaticProcess.Description);

            _enzymaticProcessWithSpecies = new EnzymaticProcessWithSpecies
            {
                Name         = "Enzymatic process with species",
                Description  = "toto",
                Species      = new Species().WithName("Human"),
                InternalName = "C",
                DataSource   = "D",
            };

            A.CallTo(() => _representationInfoRepository.DescriptionFor(RepresentationObjectType.PROCESS, _enzymaticProcessWithSpecies.InternalName)).Returns("Process description");

            return(Task.FromResult(true));
        }
 protected override async Task Because()
 {
     _newEnzymaticProcess = await sut.MapToModel(_snapshot, new SnapshotContext()) as EnzymaticProcessWithSpecies;
 }