public void ShouldConvertVariableToFieldAndInsertFieldDeclarationOnLastLineOfClassDeclarations()
        {
            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("x = a - b"));

            manipulator.ConvertVariableToField();

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


            Assert.AreEqual("        private int x;", testBuffer.CurrentSnapshot.Lines.ElementAt(5).GetText());
            Assert.AreEqual("            x = a - b + c * d / e % 3444;", testBuffer.CurrentSnapshot.Lines.ElementAt(9).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));
 }