protected override void Context() { base.Context(); _reactionPartnerBuilder = new ReactionPartnerBuilder("moleculeName", 1.0); _reactionPartnerDTO = new ReactionPartnerBuilderDTO(_reactionPartnerBuilder); sut.InitializeWith(_commandCollector); sut.Edit(_reactionBuilderDTO, _reactionBuildingBlock); }
protected override void Context() { base.Context(); _reactionPartnerBuilder = new ReactionPartnerBuilder("moleculeName", 2.0); _reactionPartnerDTO = new ReactionPartnerBuilderDTO(_reactionPartnerBuilder); sut.Edit(_reactionBuilderDTO, _reactionBuildingBlock); }
private IContextMenu createFor(ReactionPartnerBuilderDTO reactionPartnerDTO, IReactionProductsPresenter presenter) { var reactionBuilder = presenter.Subject.DowncastTo <IReactionBuilder>(); IReactionPartnerBuilder reactionPartnerBuilder = null; if (reactionPartnerDTO != null) { reactionPartnerBuilder = reactionBuilder.Products.FirstOrDefault(product => product.MoleculeName.Equals(reactionPartnerDTO.MoleculeName)); } return(new ContextMenuForProductBuilder(reactionBuilder, reactionPartnerBuilder)); }
protected override void Context() { base.Context(); _reactionBuilder = new ReactionBuilder(); var reactionPartnerBuilder = new ReactionPartnerBuilder("A", 1); _reactionBuilder.AddProduct(reactionPartnerBuilder); _dto = new ReactionPartnerBuilderDTO(reactionPartnerBuilder); A.CallTo(() => _reactionProductsPresenter.Subject).Returns(_reactionBuilder); }
protected override void Context() { base.Context(); _reactionPartnerBuilder = new ReactionPartnerBuilder("moleculeName", 2.0); _reactionPartnerDTO = new ReactionPartnerBuilderDTO(_reactionPartnerBuilder); _reactionBuilderDTO.Educts.Add(_reactionPartnerDTO); _reactionBuilderDTO.ReactionBuilder.AddEduct(_reactionPartnerBuilder); _reactionBuildingBlock.DiagramModel = A.Fake <IDiagramModel>(); A.CallTo(() => _interactionTaskForReactionBuilder.SelectMoleculeNames(_reactionBuildingBlock, A <IEnumerable <string> > ._, A <string> ._, AppConstants.Captions.Educts)).Returns(new List <string> { "moleculeName" }); sut.Edit(_reactionBuilderDTO, _reactionBuildingBlock); }
public void SetPartnerMoleculeName(string newMoleculeName, ReactionPartnerBuilderDTO reactionPartnerDTO) { var partner = reactionPartnerDTO.PartnerBuilder; AddCommand(new EditReactionPartnerMoleculeNameCommand(newMoleculeName, _reactionBuilderDTO.ReactionBuilder, partner, ReactionBuildingBlock).Run(_context)); }
public void SetStochiometricCoefficient(double newCoefficient, ReactionPartnerBuilderDTO reactionPartnerDTO) { var partner = reactionPartnerDTO.PartnerBuilder; AddCommand(new EditReactionPartnerStoichiometricCoefficientCommand(newCoefficient, _reactionBuilderDTO.ReactionBuilder, partner, ReactionBuildingBlock).Run(_context)); }