public void RemoveParameters_CanExecute_Function_OneParam() { var input = @"Function foo(value) As Integer End Function"; var vbe = MockVbeBuilder.BuildFromSingleStandardModule(input, out _, new Selection(1, 11, 1, 11)); var(state, rewritingManager) = MockParser.CreateAndParseWithRewritingManager(vbe.Object); using (state) { var removeParametersCommand = new RefactorRemoveParametersCommand(vbe.Object, state, null, rewritingManager); Assert.IsTrue(removeParametersCommand.CanExecute(null)); } }
public void RemoveParameters_CanExecute_PropertySet_OneParam() { var input = @"Property Set foo(value) End Property"; var vbe = MockVbeBuilder.BuildFromSingleStandardModule(input, out _, new Selection(1, 16, 1, 16)); var(state, rewritingManager) = MockParser.CreateAndParseWithRewritingManager(vbe.Object); using (state) { var removeParametersCommand = new RefactorRemoveParametersCommand(vbe.Object, state, null, rewritingManager); Assert.IsFalse(removeParametersCommand.CanExecute(null)); } }
public void RemoveParameters_CanExecute_Function_OneParam() { var input = @"Function foo(value) As Integer End Function"; IVBComponent component; var vbe = MockVbeBuilder.BuildFromSingleStandardModule(input, out component, new Selection(1, 11, 1, 11)); using (var state = MockParser.CreateAndParse(vbe.Object)) { var removeParametersCommand = new RefactorRemoveParametersCommand(vbe.Object, state, null); Assert.IsTrue(removeParametersCommand.CanExecute(null)); } }
public void RemoveParameters_CanExecute_PropertySet_TwoParams() { var input = @"Property Set foo(value1, value2) End Property"; IVBComponent component; var vbe = MockVbeBuilder.BuildFromSingleStandardModule(input, out component, new Selection(1, 16, 1, 16)); using (var state = MockParser.CreateAndParse(vbe.Object)) { var removeParametersCommand = new RefactorRemoveParametersCommand(vbe.Object, state, null); Assert.IsTrue(removeParametersCommand.CanExecute(null)); } }
public void RemoveParameters_CanExecute_Proc_NoParams() { var input = @"Sub foo() End Sub"; IVBComponent component; var vbe = MockVbeBuilder.BuildFromSingleStandardModule(input, out component, new Selection(1, 6, 1, 6)); using (var state = MockParser.CreateAndParse(vbe.Object)) { var removeParametersCommand = new RefactorRemoveParametersCommand(vbe.Object, state, null); Assert.IsFalse(removeParametersCommand.CanExecute(null)); } }