public void ShouldAssignParameterToFieldAndInsertFieldDeclarationOnLastLineOfClassDeclarationsPlusAssignmentInMethod()
        {
            StringTextBuffer testBuffer = new StringTextBuffer(ExpressionInContext("int x = a - b + c * d / e % 3444;"));

            mockView.Setup(m => m.TextBuffer).Returns(testBuffer);
            mockView.Setup(m => m.Caret.Position).Returns(testBuffer.GetPositionAtStartOf("arg1,"));

            manipulator.AssignParameterToField();

            Console.Out.Write(testBuffer.CurrentSnapshot.GetText());


            Assert.AreEqual("        private string[] arg1;", testBuffer.CurrentSnapshot.Lines.ElementAt(5).GetText());
            Assert.AreEqual("            this.arg1 = arg1;", testBuffer.CurrentSnapshot.Lines.ElementAt(10).GetText());
        }
 public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 {
     if (pguidCmdGroup == GuidList.guidLocalRefactorCmdSet)
     {
         if (nCmdID == PkgCmdIDList.cmdidExtractVariable)
         {
             codeManipulator.ExtractVariable();
             return(VSConstants.S_OK);
         }
         if (nCmdID == PkgCmdIDList.cmdidExtractConstant)
         {
             codeManipulator.ExtractConstant();
             return(VSConstants.S_OK);
         }
         if (nCmdID == PkgCmdIDList.cmdidAssignParameter)
         {
             codeManipulator.AssignParameterToField();
             return(VSConstants.S_OK);
         }
         if (nCmdID == PkgCmdIDList.cmdidConvertVariable)
         {
             codeManipulator.ConvertVariableToField();
             return(VSConstants.S_OK);
         }
     }
     return(Next.Exec(ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut));
 }