Skip to content

Commit f17b1f7

Browse files
committed
Add tests for MoveContainingFolderRefactoring itself
There are already tests for the involved refactoring actions.
1 parent 50299d8 commit f17b1f7

File tree

2 files changed

+391
-1
lines changed

2 files changed

+391
-1
lines changed

RubberduckTests/Refactoring/InteractiveRefactoringTestBase.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ protected IDictionary<string, string> RefactoredCode(string declarationName, Dec
9393
return RefactoredCode(vbe, declarationName, declarationType, presenterAdjustment, expectedException);
9494
}
9595

96-
protected IDictionary<string, string> RefactoredCode(IVBE vbe, string declarationName, DeclarationType declarationType, Func<TModel, TModel> presenterAdjustment, Type expectedException = null)
96+
protected IDictionary<string, string> RefactoredCode(IVBE vbe, string declarationName, DeclarationType declarationType, Func<TModel, TModel> presenterAdjustment, Type expectedException = null, bool extractAllProjects = false)
9797
{
9898
var (state, rewritingManager) = MockParser.CreateAndParseWithRewritingManager(vbe);
9999
using (state)
@@ -112,6 +112,12 @@ protected IDictionary<string, string> RefactoredCode(IVBE vbe, string declaratio
112112
refactoring.Refactor(target);
113113
}
114114

115+
if (extractAllProjects)
116+
{
117+
return state.ProjectsProvider.Components()
118+
.Select(tpl => tpl.Component)
119+
.ToDictionary(component => component.Name, component => component.CodeModule.Content());
120+
}
115121
return vbe.ActiveVBProject.VBComponents
116122
.ToDictionary(component => component.Name, component => component.CodeModule.Content());
117123
}

0 commit comments

Comments
 (0)