Ejemplo n.º 1
0
        protected override IRefactoringAction <ChangeFolderModel> TestBaseRefactoring(RubberduckParserState state, IRewritingManager rewritingManager)
        {
            var annotationUpdater  = new AnnotationUpdater(state);
            var moveToFolderAction = new MoveToFolderRefactoringAction(rewritingManager, annotationUpdater);

            return(new ChangeFolderRefactoringAction(rewritingManager, moveToFolderAction));
        }
Ejemplo n.º 2
0
 public ChangeFolderRefactoringAction(
     IRewritingManager rewritingManager,
     MoveToFolderRefactoringAction moveToFolder)
     : base(rewritingManager)
 {
     _moveToFolder = moveToFolder;
 }
Ejemplo n.º 3
0
        //The only relevant test is in the base class.

        protected override CommandBase TestCommand(
            IVBE vbe,
            RubberduckParserState state,
            IRewritingManager rewritingManager,
            ISelectionService selectionService)
        {
            var factory = new Mock <IRefactoringPresenterFactory>().Object;
            var msgBox  = new Mock <IMessageBox>().Object;

            var uiDispatcherMock = new Mock <IUiDispatcher>();

            uiDispatcherMock
            .Setup(m => m.Invoke(It.IsAny <Action>()))
            .Callback((Action action) => action.Invoke());
            var userInteraction = new RefactoringUserInteraction <IMoveMultipleFoldersPresenter, MoveMultipleFoldersModel>(factory, uiDispatcherMock.Object);

            var annotationUpdater         = new AnnotationUpdater(state);
            var moveToFolderAction        = new MoveToFolderRefactoringAction(rewritingManager, annotationUpdater);
            var changeFolderAction        = new ChangeFolderRefactoringAction(rewritingManager, moveToFolderAction);
            var moveFolderAction          = new MoveFolderRefactoringAction(rewritingManager, changeFolderAction);
            var moveMultipleFoldersAction = new MoveMultipleFoldersRefactoringAction(rewritingManager, moveFolderAction);

            var selectedDeclarationProvider = new SelectedDeclarationProvider(selectionService, state);

            var refactoring = new MoveContainingFolderRefactoring(moveMultipleFoldersAction, selectedDeclarationProvider, selectionService, userInteraction, state, state);
            var notifier    = new MoveContainingFolderRefactoringFailedNotifier(msgBox);

            return(new CodePaneRefactorMoveContainingFolderCommand(refactoring, notifier, selectionService, state, selectedDeclarationProvider));
        }
Ejemplo n.º 4
0
        protected override IRefactoring TestRefactoring(
            IRewritingManager rewritingManager,
            RubberduckParserState state,
            RefactoringUserInteraction <IMoveMultipleToFolderPresenter, MoveMultipleToFolderModel> userInteraction,
            ISelectionService selectionService)
        {
            var annotationUpdater          = new AnnotationUpdater(state);
            var moveToFolderAction         = new MoveToFolderRefactoringAction(rewritingManager, annotationUpdater);
            var moveMultipleToFolderAction = new MoveMultipleToFolderRefactoringAction(rewritingManager, moveToFolderAction);

            var selectedDeclarationProvider = new SelectedDeclarationProvider(selectionService, state);

            return(new MoveToFolderRefactoring(moveMultipleToFolderAction, selectedDeclarationProvider, selectionService, userInteraction, state));
        }