protected override void Context()
        {
            base.Context();
            _template1 = new EnzymaticProcess().WithName("Proc1");
            _template1.InternalName   = "Proc1";
            _template1.MetaboliteName = "META";
            _template2 = new EnzymaticProcess().WithName("Proc2");
            _template2.InternalName = "Proc2";
            _allProcessTemplates.AddRange(new[] { _template1, _template2 });
            _process1DTO = new PartialProcessDTO(_template1)
            {
                MoleculeName = "Protein",
                DataSource   = "Lab"
            };
            _process2DTO = new PartialProcessDTO(_template2);

            A.CallTo(() => _compoundProcessTask.CreateProcessFromTemplate <CompoundProcess>(_template1, _compound)).Returns(_template1);
            A.CallTo(() => _compoundProcessTask.CreateProcessFromTemplate <CompoundProcess>(_template2, _compound)).Returns(_template2);
            A.CallTo(() => _processMapper.MapFrom(_template1)).Returns(_process1DTO);
            A.CallTo(() => _processMapper.MapFrom(_template2)).Returns(_process2DTO);
            A.CallTo(() => _partialProcessMapper.MapFrom(_template1, _compound)).Returns(_process1DTO);
            A.CallTo(() => _partialProcessMapper.MapFrom(_template2, _compound)).Returns(_process2DTO);
            sut.CreateProcess(_compound, _allProcessTemplates);

            A.CallTo(() => _view.BindTo(A <EnzymaticProcessDTO> ._))
            .Invokes(x => _enzymaticPartialProcessDTO = x.GetArgument <EnzymaticProcessDTO>(0));
        }
Esempio n. 2
0
        protected override void Rebind(EnzymaticProcess enzymaticProcess, Compound compound)
        {
            var previousMetaboliteName = _enzymaticProcessDTO.Metabolite;

            enzymaticProcess.MetaboliteName = previousMetaboliteName;
            _enzymaticProcessDTO            = dtoFrom(enzymaticProcess);
            base.Rebind(enzymaticProcess, compound);
        }
Esempio n. 3
0
        public EnzymaticProcessDTO MapFrom(EnzymaticProcess compoundProcess)
        {
            var dto = new EnzymaticProcessDTO(compoundProcess);

            SetProperties(compoundProcess, dto);
            dto.Metabolite = compoundProcess.MetaboliteName;
            return(dto);
        }
 protected override void Context()
 {
     base.Context();
     _enzymaticProcess = new EnzymaticProcess();
     _dto = new EnzymaticProcessDTO(_enzymaticProcess)
     {
         Name = "myProcessDTO"
     };
     A.CallTo(() => _enzymaticProcessToEnzymaticProcessDTOMapper.MapFrom(_enzymaticProcess)).Returns(_dto);
 }
Esempio n. 5
0
 public void BindTo(EnzymaticProcessDTO enzymaticProcessDTO)
 {
     _screenBinder.BindToSource(enzymaticProcessDTO);
 }
Esempio n. 6
0
 protected override void EditProcess(EnzymaticProcess enzymaticProcess, Compound compound)
 {
     _view.UpdateAvailableCompounds(allPossibleMetabolites().Where(x => !Equals(x, compound)).Select(x => x.Name));
     _enzymaticProcessDTO = dtoFrom(enzymaticProcess);
     base.EditProcess(enzymaticProcess, compound);
 }
 protected override void Because()
 {
     _result = sut.MapFrom(_process);
 }