Esempio n. 1
0
 protected override void Context()
 {
     _workspace                     = A.Fake <IWorkspace>();
     _view                          = A.Fake <IEditRandomPopulationView>();
     _subPresenterManager           = SubPresenterHelper.Create <IPopulationItemPresenter>();
     _popSettingsPresenter          = _subPresenterManager.CreateFake(RamdomPopulationItems.Settings);
     _popAdvancedParameterPresenter = _subPresenterManager.CreateFake(RamdomPopulationItems.AdvancedParameters);
     _popDistributionPresenter      = _subPresenterManager.CreateFake(RamdomPopulationItems.ParameterDistribution);
     //This line is required because of some generic issues
     A.CallTo(_subPresenterManager).WithReturnType <IPopulationSettingsPresenter <RandomPopulation> >().Returns(_popSettingsPresenter);
     _randomPopulation = A.Fake <RandomPopulation>();
     A.CallTo(() => _popSettingsPresenter.Population).Returns(_randomPopulation);
     sut = new EditRandomPopulationPresenter(_view, _subPresenterManager);
     sut.InitializeWith(_workspace);
 }
 protected override void Context()
 {
     _buildingBlockDTOFactory = A.Fake <IObjectBaseDTOFactory>();
     _subPresenterManager     = SubPresenterHelper.Create <IPopulationItemPresenter>();
     _propertiesMapper        = A.Fake <IBuildingBlockPropertiesMapper>();
     _view = A.Fake <ICreateRandomPopulationView>();
     _popSettingsPresenter          = _subPresenterManager.CreateFake(RamdomPopulationItems.Settings);
     _popAdvancedParameterPresenter = _subPresenterManager.CreateFake(RamdomPopulationItems.AdvancedParameters);
     _popDistributionPresenter      = _subPresenterManager.CreateFake(RamdomPopulationItems.ParameterDistribution);
     _buildingBlockRepository       = A.Fake <IBuildingBlockRepository>();
     _dialogCreator  = A.Fake <IDialogCreator>();
     _allIndividuals = new List <Individual>();
     A.CallTo(() => _buildingBlockRepository.All <Individual>()).Returns(_allIndividuals);
     sut = new CreateRandomPopulationPresenter(_view, _subPresenterManager, _dialogCreator, _propertiesMapper, _buildingBlockDTOFactory, _buildingBlockRepository);
     sut.Initialize();
 }
 public void AttachPresenter(IRandomPopulationSettingsPresenter presenter)
 {
     _presenter = presenter;
 }