コード例 #1
0
        protected override void Context()
        {
            _view = A.Fake <ICreateSimulationView>();
            _subPresenterManager           = A.Fake <ISubPresenterItemManager <ISimulationItemPresenter> >();
            _buildConfigurationPresenter   = _subPresenterManager.CreateFake(SimulationItems.BuildConfiguration);
            _moleculeStartValuesPresenter  = _subPresenterManager.CreateFake(SimulationItems.MoleculeStartValues);
            _parameterStartValuesPresenter = _subPresenterManager.CreateFake(SimulationItems.ParameterStartValues);
            _finalActionPresenter          = _subPresenterManager.CreateFake(SimulationItems.FinalOptions);

            A.CallTo(() => _subPresenterManager.AllSubPresenters).Returns(new ISimulationItemPresenter[] { _buildConfigurationPresenter, _moleculeStartValuesPresenter, _parameterStartValuesPresenter, _finalActionPresenter });
            _context          = A.Fake <IMoBiContext>();
            _modelConstructor = A.Fake <IModelConstructor>();
            _dialogCreator    = A.Fake <IDialogCreator>();
            A.CallTo(() => _modelConstructor.CreateModelFrom(A <IBuildConfiguration> ._, A <string> ._)).Returns(A.Fake <CreationResult>());


            _validationVisitor = A.Fake <IDimensionValidator>();
            _userSettings      = A.Fake <IUserSettings>();
            _userSettings.CheckCircularReference = true;
            _simulationFactory         = A.Fake <ISimulationFactory>();
            _buildConfigurationFactory = A.Fake <IBuildConfigurationFactory>();
            _heavyWorkManager          = new HeavyWorkManagerForSpecs();
            _forbiddenNameRetriever    = A.Fake <IForbiddenNamesRetriever>();
            sut = new CreateSimulationPresenter(_view, _context, _modelConstructor, _validationVisitor,
                                                _simulationFactory, _buildConfigurationFactory, _heavyWorkManager, _subPresenterManager, _dialogCreator,
                                                _forbiddenNameRetriever, _userSettings);

            _simulation = A.Fake <IMoBiSimulation>();
            A.CallTo(() => _simulationFactory.Create()).Returns(_simulation);
            _buildConfiguration = createBuildConfiguration();
            A.CallTo(() => _simulation.MoBiBuildConfiguration).Returns(_buildConfiguration);
            A.CallTo(() => _moleculeStartValuesPresenter.StartValues).Returns(A.Fake <IMoleculeStartValuesBuildingBlock>().WithId(_useId));
            A.CallTo(() => _parameterStartValuesPresenter.StartValues).Returns(A.Fake <IParameterStartValuesBuildingBlock>().WithId(_useId));
        }
コード例 #2
0
        protected override void Context()
        {
            _simulationPropertiesDTO = new ObjectBaseDTO();
            _subPresenterManager     = SubPresenterHelper.Create <ISimulationItemPresenter>();
            _simulationModelConfigurationPresenter             = _subPresenterManager.CreateFake(SimulationItems.Model);
            _simulationCompoundConfigurationCollectorPresenter = _subPresenterManager.CreateFake(SimulationItems.Compounds);
            _simulationCompoundProtocolCollectorPresenter      = _subPresenterManager.CreateFake(SimulationItems.CompoundProtocols);
            _simulationCompoundProcessCollectorPresenter       = _subPresenterManager.CreateFake(SimulationItems.CompoundsProcesses);
            _simulationEventsConfigurationPresenter            = _subPresenterManager.CreateFake(SimulationItems.Events);
            _view = A.Fake <ICreateSimulationView>();
            _buildingBlockDTOFactory    = A.Fake <IObjectBaseDTOFactory>();
            _simulationPropertiesMapper = A.Fake <IBuildingBlockPropertiesMapper>();
            A.CallTo(() => _buildingBlockDTOFactory.CreateFor <Simulation>()).Returns(_simulationPropertiesDTO);
            _simulationModelCreator = A.Fake <ISimulationModelCreator>();
            _heavyWorkManager       = new HeavyWorkManagerForSpecs();
            _dialogCreator          = A.Fake <IDialogCreator>();

            sut = new CreateSimulationPresenter(_view, _subPresenterManager, _simulationModelCreator, _heavyWorkManager, _simulationPropertiesMapper, _buildingBlockDTOFactory, _dialogCreator);
            sut.Initialize();
        }