Exemplo n.º 1
0
		void TestExtractMethod (string inputString, string outputString)
		{
			ExtractMethodRefactoring refactoring = new ExtractMethodRefactoring ();
			RefactoringOptions options = CreateRefactoringOptions (inputString);
			ExtractMethodRefactoring.ExtractMethodParameters parameters = refactoring.CreateParameters (options);
			Assert.IsNotNull (parameters);
			parameters.Name = "NewMethod";
			parameters.InsertionPoint = new Mono.TextEditor.InsertionPoint (new DocumentLocation (options.ResolveResult.CallingMember.BodyRegion.End.Line, 0), NewLineInsertion.BlankLine, NewLineInsertion.None);
			List<Change> changes = refactoring.PerformChanges (options, parameters);
			string output = GetOutput (options, changes);
			Assert.IsTrue (CompareSource (output, outputString), "Expected:" + Environment.NewLine + outputString + Environment.NewLine + "was:" + Environment.NewLine + output);
		}