public void Edit(IndividualSimulationComparison individualSimulationComparison) { _individualSimulationComparisonPresenter.Edit(individualSimulationComparison); UpdateCaption(); updateChartVisibility(); _view.Display(); }
protected override void Context() { _chartFactory = A.Fake <IPKSimChartFactory>(); _containerTask = A.Fake <IContainerTask>(); _applicationController = A.Fake <IApplicationController>(); _project = new PKSimProject(); _objectBaseFactory = A.Fake <IObjectBaseFactory>(); _singleStartPresenterTask = A.Fake <ISingleStartPresenterTask>(); _executionContext = A.Fake <IExecutionContext>(); _simulationAnalysisCreator = A.Fake <ISimulationAnalysisCreator>(); _dialogCreator = A.Fake <IDialogCreator>(); A.CallTo(() => _executionContext.CurrentProject).Returns(_project); _individualSimulationComparison = new IndividualSimulationComparison().WithName("chart"); sut = new SimulationComparisonTask( _chartFactory, _containerTask, _objectBaseFactory, _applicationController, _singleStartPresenterTask, _executionContext, _simulationAnalysisCreator, _dialogCreator); }
protected override void Context() { base.Context(); _individualSimulationComparison = new IndividualSimulationComparison(); A.CallTo(() => _chartFactory.CreateSummaryChart()).Returns(_individualSimulationComparison); A.CallTo(() => _executionContext.PublishEvent(A <SimulationComparisonCreatedEvent> .Ignored)).Invokes( x => _event = x.GetArgument <SimulationComparisonCreatedEvent>(0)); }
protected override async Task Context() { await base.Context(); _snapshot = await sut.MapToSnapshot(_individualSimulationComparison); var individualSimulationComparison = new IndividualSimulationComparison(); A.CallTo(() => _individualSimulationComparisonMapper.MapToModel(_snapshot.IndividualComparison, A <SimulationAnalysisContext> ._)).Returns(individualSimulationComparison); }
protected override Task Context() { _individualSimulationComparisonMapper = A.Fake <IndividualSimulationComparisonMapper>(); _populationAnalysisChartMapper = A.Fake <PopulationAnalysisChartMapper>(); _objectBaseFactory = A.Fake <IObjectBaseFactory>(); sut = new SimulationComparisonMapper(_individualSimulationComparisonMapper, _populationAnalysisChartMapper, _objectBaseFactory); _individualSimulation1 = new IndividualSimulation().WithName("IndS1").WithId("IndS1"); _individualSimulation2 = new IndividualSimulation().WithName("IndS2").WithId("IndS2"); _individualSimulationComparison = new IndividualSimulationComparison { Name = "IndividualComparison", Description = "IndividualComparison Description", }; _individualSimulationComparison.AddSimulation(_individualSimulation1); _individualSimulationComparison.AddSimulation(_individualSimulation2); _populationSimulation1 = new PopulationSimulation().WithName("PopS1").WithId("PopS1"); _populationSimulation2 = new PopulationSimulation().WithName("PopS2").WithId("PopS2"); _referenceSimulation = new PopulationSimulation().WithName("PopS3").WithId("PopS3"); _populationSimulationComparison = new PopulationSimulationComparison { Name = "PopulationComparison", Description = "PopulationComparison Description", }; _populationSimulationAnalysis = new BoxWhiskerAnalysisChart(); _populationSimulationComparison.AddSimulation(_populationSimulation1); _populationSimulationComparison.AddSimulation(_populationSimulation2); _populationSimulationComparison.AddAnalysis(_populationSimulationAnalysis); _populationSimulationComparison.ReferenceGroupingItem = new GroupingItem(); _populationSimulationComparison.ReferenceSimulation = _referenceSimulation; _curveChart = new CurveChart(); A.CallTo(() => _individualSimulationComparisonMapper.MapToSnapshot(_individualSimulationComparison)).Returns(_curveChart); _populationAnalysisChartSnapshot = new Snapshots.PopulationAnalysisChart(); A.CallTo(() => _populationAnalysisChartMapper.MapToSnapshot(_populationSimulationAnalysis)).Returns(_populationAnalysisChartSnapshot); _project = new PKSimProject(); _project.AddBuildingBlock(_individualSimulation1); _project.AddBuildingBlock(_individualSimulation2); _project.AddBuildingBlock(_populationSimulation1); _project.AddBuildingBlock(_populationSimulation2); _project.AddBuildingBlock(_referenceSimulation); _snapshotContext = new SnapshotContext(_project, ProjectVersions.V10); return(_completed); }
protected override void Context() { _dialogCreator = A.Fake <IDialogCreator>(); _applicationController = A.Fake <IApplicationController>(); _workspace = A.Fake <IWorkspace>(); _project = A.Fake <IPKSimProject>(); _registrationTask = A.Fake <IRegistrationTask>(); A.CallTo(() => _workspace.Project).Returns(_project); _eventPublisher = A.Fake <IEventPublisher>(); sut = new DeleteSimulationComparisonsUICommand(_applicationController, _workspace, _eventPublisher, _dialogCreator, _registrationTask); _individualSimulationComparison = new IndividualSimulationComparison().WithName("chart"); sut.For(new [] { _individualSimulationComparison }); }
protected override void Context() { base.Context(); _simulationComparison = new IndividualSimulationComparison(); var curve = A.Fake <Curve>(); _dataRepository = new DataRepository(); _dataColumn = new DataColumn { Repository = _dataRepository }; A.CallTo(() => curve.xData).Returns(_dataColumn); _simulationComparison.AddCurve(curve); }
protected override void Context() { base.Context(); _individualSimulationComparison = new IndividualSimulationComparison(); _individualSimulationComparison.Curves.Add(new Curve("TOTO")); sut.InitializeAnalysis(_individualSimulationComparison); _simulation = A.Fake <IndividualSimulation>(); A.CallTo(() => _simulation.HasResults).Returns(true); var simulationNode = new SimulationNode(new ClassifiableSimulation { Subject = _simulation }); _dropEventArgs = new DragEventArgs(new DataObject(new DragDropInfo(new List <SimulationNode> { simulationNode })), 0, 0, 0, DragDropEffects.All, DragDropEffects.All); }
private ISimulationComparison mapFrom(SimulationComparisonMetaData simulationComparisonMetaData) { ISimulationComparison simulationComparison; if (simulationComparisonMetaData.IsAnImplementationOf <IndividualSimulationComparisonMetaData>()) { simulationComparison = new IndividualSimulationComparison(); } else if (simulationComparisonMetaData.IsAnImplementationOf <PopulationSimulationComparisonMetaData>()) { simulationComparison = new PopulationSimulationComparison(); } else { throw new ArgumentException($"Unable to serialize simulation comparison of type {simulationComparisonMetaData.GetType()}"); } return(simulationComparison .WithId(simulationComparisonMetaData.Id) .WithName(simulationComparisonMetaData.Name) .WithDescription(simulationComparisonMetaData.Description)); }
protected override void Context() { base.Context(); _dimensionFactory = A.Fake <IDimensionFactory>(); _individualSimulationComparison = new IndividualSimulationComparison(); var dataRepository = DomainHelperForSpecs.ObservedData(); var curve = new Curve(); curve.SetxData(dataRepository.BaseGrid, _dimensionFactory); curve.SetyData(dataRepository.FirstDataColumn(), _dimensionFactory); _individualSimulationComparison.AddCurve(curve); sut.InitializeAnalysis(_individualSimulationComparison); _simulation = A.Fake <IndividualSimulation>(); A.CallTo(() => _simulation.HasResults).Returns(true); var simulationNode = new SimulationNode(new ClassifiableSimulation { Subject = _simulation }); _dropEventArgs = new DragEventArgs(new DataObject(new DragDropInfo(new List <SimulationNode> { simulationNode })), 0, 0, 0, DragDropEffects.All, DragDropEffects.All); }
public void Visit(IndividualSimulationComparison objToVisit) { openPresenter(objToVisit); }
protected override void Context() { base.Context(); _individualSimulationComparison = new IndividualSimulationComparison(); }