public void testNoParenthesisSurrounderForLambdaParameter() { configureByFile(BASE_PATH + getTestName(false) + ".java"); SurroundDescriptor item = ContainerUtil.getFirstItem( LanguageSurrounders.INSTANCE.allForLanguage(JavaLanguage.INSTANCE)); assertNotNull(item); SelectionModel selectionModel = getEditor().getSelectionModel(); PsiElement[] elements = item.getElementsToSurround( getFile(), selectionModel.getSelectionStart(), selectionModel.getSelectionEnd()); assertEmpty(elements); }
private void doTest(@NotNull String fileName, Surrounder surrounder) { configureByFile(BASE_PATH + fileName + ".java"); SurroundDescriptor item = ContainerUtil.getFirstItem( LanguageSurrounders.INSTANCE.allForLanguage(JavaLanguage.INSTANCE)); assertNotNull(item); SelectionModel selectionModel = getEditor().getSelectionModel(); PsiElement[] elements = item.getElementsToSurround( getFile(), selectionModel.getSelectionStart(), selectionModel.getSelectionEnd()); assertTrue(surrounder.isApplicable(elements)); SurroundWithHandler.invoke(getProject(), getEditor(), getFile(), surrounder); checkResultByFile(BASE_PATH + fileName + "_after.java"); }