public SimulationReactionDiagramDTO MapFrom(Simulation simulation) { var dto = new SimulationReactionDiagramDTO { DiagramModel = simulation.ReactionDiagramModel, ReactionBuildingBlock = simulation.Reactions ?? _reactionBuildingBlockCreator.CreateFor(simulation), DiagramManager = new ReactionDiagramManager <SimulationReactionDiagramDTO>() }; reIdNodesFromNewBuildingBlock(dto.DiagramModel, dto.ReactionBuildingBlock); return(dto); }
protected override void Context() { _diagramLayoutTask = A.Fake <IDiagramLayoutTask>(); _mapper = A.Fake <ISimulationToSimulationReactionDiagramDTOMapper>(); _diagramModelFactory = A.Fake <IDiagramModelFactory>(); _simulationReactionDiagramDTO = new SimulationReactionDiagramDTO { DiagramModel = A.Fake <IDiagramModel>(), DiagramManager = A.Fake <IDiagramManager <SimulationReactionDiagramDTO> >() }; sut = new ReactionDiagramPresenter(A.Fake <IReactionDiagramView>(), A.Fake <IContainerBaseLayouter>(), A.Fake <IDialogCreator>(), _diagramModelFactory, A.Fake <IUserSettings>(), _diagramLayoutTask, _mapper); A.CallTo(_mapper).WithReturnType <SimulationReactionDiagramDTO>().Returns(_simulationReactionDiagramDTO); }
protected override void Because() { _dto = sut.MapFrom(_simulation); }