Exemple #1
0
        protected override void Context()
        {
            base.Context();
            _multipleStringSelectionPresenter = A.Fake <IMultipleStringSelectionPresenter>();
            A.CallTo(() => _moBiApplicationController.Start <IMultipleStringSelectionPresenter>()).Returns(_multipleStringSelectionPresenter);

            A.CallTo(() => _multipleStringSelectionPresenter.Show(A <string> ._, A <string> ._, A <IEnumerable <string> > ._, A <string> ._, true)).
            Invokes(x => _possibleMoleculeNames = x.GetArgument <IEnumerable <string> >(2)).Returns(Enumerable.Empty <string>());

            _moleculeBuildingBlocks = new List <IMoleculeBuildingBlock>
            {
                new MoleculeBuildingBlock {
                    new MoleculeBuilder {
                        Name = "b"
                    }, new MoleculeBuilder {
                        Name = "a"
                    }
                },
                new MoleculeBuildingBlock {
                    new MoleculeBuilder {
                        Name = "a"
                    }, new MoleculeBuilder {
                        Name = "b"
                    }
                }
            };

            A.CallTo(() => _moBiContext.CurrentProject.MoleculeBlockCollection).Returns(_moleculeBuildingBlocks);
        }
        protected override void Context()
        {
            _reactionDimensionRetriever = A.Fake <IReactionDimensionRetriever>();
            _editTaskFor            = A.Fake <IEditTaskFor <IReactionBuilder> >();
            _interactionTaskContext = A.Fake <IInteractionTaskContext>();
            sut = new InteractionTasksForReactionBuilder(_interactionTaskContext, _editTaskFor, _reactionDimensionRetriever);

            _moBiApplicationController        = A.Fake <IMoBiApplicationController>();
            _multipleStringSelectionPresenter = A.Fake <IMultipleStringSelectionPresenter>();
            A.CallTo(() => _interactionTaskContext.ApplicationController).Returns(_moBiApplicationController);
            A.CallTo(() => _moBiApplicationController.Start <IMultipleStringSelectionPresenter>()).Returns(_multipleStringSelectionPresenter);
        }