protected override void Context() { _view = A.Fake <IAdvancedParameterDistributionView>(); _representationInfoRepository = A.Fake <IRepresentationInfoRepository>(); _entityPathResolver = A.Fake <IEntityPathResolver>(); _parametersPresenter = A.Fake <IPopulationParameterGroupsPresenter>(); _popParameterDistributionPresenter = A.Fake <IPopulationDistributionPresenter>(); _population = A.Fake <Population>(); _projectChangedNotifier = A.Fake <IProjectChangedNotifier>(); _gender1 = A.Fake <Gender>().WithName("Gender1"); _gender2 = A.Fake <Gender>().WithName("Gender2"); A.CallTo(() => _population.AllGenders()).Returns(new[] { _gender1, _gender2 }); A.CallTo(() => _representationInfoRepository.DisplayNameFor(_gender1)).Returns("Display1"); A.CallTo(() => _representationInfoRepository.DisplayNameFor(_gender2)).Returns("Display2"); _allParameters = new List <IParameter>(); _allParametersCache = new PathCacheForSpecs <IParameter>(); A.CallTo(() => _population.AllVectorialParameters(_entityPathResolver)).Returns(_allParameters); A.CallTo(() => _population.AllParameters(_entityPathResolver)).Returns(_allParametersCache); A.CallTo(() => _popParameterDistributionPresenter.Plot(_population, A <IParameter> ._, A <DistributionSettings> ._, A <IDimension> ._, A <Unit> ._)) .Invokes(x => _settings = x.GetArgument <DistributionSettings>(2)); sut = new PopulationAdvancedParameterDistributionPresenter(_view, _parametersPresenter, _representationInfoRepository, _entityPathResolver, _popParameterDistributionPresenter, _projectChangedNotifier); }
public ExecutionContext(IPKSimProjectRetriever projectRetriever, IWithIdRepository withIdRepository, ILazyLoadTask lazyLoadTask, IRegistrationTask registrationTask, IEventPublisher eventPublisher, IObjectTypeResolver objectTypeResolver, IBuildingBlockRetriever buildingBlockRetriever, ICompressedSerializationManager serializationManager, IBuildingBlockVersionUpdater buildingBlockVersionUpdater, IProjectChangedNotifier projectChangedNotifier, ICloner cloner, IContainer container, IReportGenerator reportGenerator, IFullPathDisplayResolver fullPathDisplayResolver, IParameterChangeUpdater parameterChangeUpdater) { _projectRetriever = projectRetriever; _withIdRepository = withIdRepository; _lazyLoadTask = lazyLoadTask; _registrationTask = registrationTask; _eventPublisher = eventPublisher; _objectTypeResolver = objectTypeResolver; _buildingBlockRetriever = buildingBlockRetriever; _serializationManager = serializationManager; _buildingBlockVersionUpdater = buildingBlockVersionUpdater; _projectChangedNotifier = projectChangedNotifier; CloneManager = cloner; _container = container; _reportGenerator = reportGenerator; _fullPathDisplayResolver = fullPathDisplayResolver; _parameterChangeUpdater = parameterChangeUpdater; }
protected override void Context() { _projectRetriever = A.Fake <IPKSimProjectRetriever>(); _registrationTask = A.Fake <IRegistrationTask>(); _eventPublisher = A.Fake <IEventPublisher>(); _lazyLoadTask = A.Fake <ILazyLoadTask>(); _objectTypeResolver = A.Fake <IObjectTypeResolver>(); _buildingBlockRetriever = A.Fake <IBuildingBlockRetriever>(); _buildingBlockVersionUpdater = A.Fake <IBuildingBlockVersionUpdater>(); _projectChangedNotifier = A.Fake <IProjectChangedNotifier>(); _withIdRepository = A.Fake <IWithIdRepository>(); _stringSerializer = A.Fake <ICompressedSerializationManager>(); _cloneManager = A.Fake <ICloner>(); _reportGenerator = A.Fake <IReportGenerator>(); _fullPathDisplayResolver = A.Fake <IFullPathDisplayResolver>(); _project = A.Fake <IPKSimProject>(); _idThatDoesNotExist = "tralalalal"; _parameter = A.Fake <IParameter>(); _parameterChangeUpdater = A.Fake <IParameterChangeUpdater>(); A.CallTo(() => _projectRetriever.CurrentProject).Returns(_project); _idThatDoesExist = "toto"; _container = A.Fake <IContainer>(); A.CallTo(() => _withIdRepository.ContainsObjectWithId(_idThatDoesExist)).Returns(true); A.CallTo(() => _withIdRepository.Get <IParameter>(_idThatDoesExist)).Returns(_parameter); A.CallTo(() => _withIdRepository.Get(_idThatDoesExist)).Returns(_parameter); A.CallTo(() => _withIdRepository.ContainsObjectWithId(_idThatDoesNotExist)).Returns(false); A.CallTo(() => _withIdRepository.Get(_idThatDoesNotExist)).Throws(new Exception()); sut = new ExecutionContext(_projectRetriever, _withIdRepository, _lazyLoadTask, _registrationTask, _eventPublisher, _objectTypeResolver, _buildingBlockRetriever, _stringSerializer, _buildingBlockVersionUpdater, _projectChangedNotifier, _cloneManager, _container, _reportGenerator, _fullPathDisplayResolver, _parameterChangeUpdater); }
protected override void Context() { _projectChangedNotifier = A.Fake <IProjectChangedNotifier>(); _chartTemplatingTask = A.Fake <IChartTemplatingTask>(); _projectRetriever = A.Fake <IProjectRetriever>(); _exportChartToPDFCommand = A.Fake <ExportChartToPDFCommand>(); sut = new ChartTask(_projectChangedNotifier, _projectRetriever, _exportChartToPDFCommand); }
public EditorViewModel(IUiService uiService, IProjectChangedNotifier projectChangedNotifier) { WireCommands(); this.InitEnumValues(); this.uiService = uiService; this.projectChangedNotifier = projectChangedNotifier; // event registration this.projectChangedNotifier.SelectedProjectChanged += OnSelectedProjectChanged; BaseLayer.SelectedItemChanged += OnSelectedItemChanged; }
protected AdvancedParameterDistributionPresenter(IAdvancedParameterDistributionView view, IPopulationParameterGroupsPresenter parametersPresenter, IRepresentationInfoRepository representationInfoRepository, IEntityPathResolver entityPathResolver, IPopulationDistributionPresenter populationParameterDistributionPresenter, IProjectChangedNotifier projectChangedNotifier) : base(view) { _parametersPresenter = parametersPresenter; _representationInfoRepository = representationInfoRepository; _entityPathResolver = entityPathResolver; _populationParameterDistributionPresenter = populationParameterDistributionPresenter; _projectChangedNotifier = projectChangedNotifier; _defaultSettings = new DistributionSettings(); _parametersPresenter.GroupNodeSelected += (o, e) => activateNode(e.Node); _parametersPresenter.ParameterNodeSelected += (o, e) => activateNode(e.Node); _view.UpdateParameterGroupView(_parametersPresenter.View); _allParametersCache = new PathCache <IParameter>(_entityPathResolver); _view.AddDistributionView(_populationParameterDistributionPresenter.View); AddSubPresenters(_parametersPresenter, _populationParameterDistributionPresenter); }
public ChartTask(IProjectChangedNotifier projectChangedNotifier, IProjectRetriever projectRetriever, ExportChartToPDFCommand exportChartToPDFCommand) { _projectChangedNotifier = projectChangedNotifier; _projectRetriever = projectRetriever; _exportChartToPDFCommand = exportChartToPDFCommand; }
public PopulationSimulationComparisonDistributionPresenter(IAdvancedParameterDistributionView view, IPopulationParameterGroupsPresenter parametersPresenter, IRepresentationInfoRepository representationInfoRepository, IEntityPathResolver entityPathResolver, IPopulationDistributionPresenter populationParameterDistributionPresenter, IProjectChangedNotifier projectChangedNotifier) : base(view, parametersPresenter, representationInfoRepository, entityPathResolver, populationParameterDistributionPresenter, projectChangedNotifier) { }