From f094e6f168ba5a3e0e29956ba93d0bc72f9bdaad Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Tue, 26 Feb 2013 10:00:08 +0100 Subject: [PATCH] Test renamed --- ...iNameHelperTest.java => NameUtilTest.java} | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) rename platform/platform-tests/testSrc/com/intellij/psi/{PsiNameHelperTest.java => NameUtilTest.java} (54%) diff --git a/platform/platform-tests/testSrc/com/intellij/psi/PsiNameHelperTest.java b/platform/platform-tests/testSrc/com/intellij/psi/NameUtilTest.java similarity index 54% rename from platform/platform-tests/testSrc/com/intellij/psi/PsiNameHelperTest.java rename to platform/platform-tests/testSrc/com/intellij/psi/NameUtilTest.java index 8ba390ceee77..d5a7e2d49519 100644 --- a/platform/platform-tests/testSrc/com/intellij/psi/PsiNameHelperTest.java +++ b/platform/platform-tests/testSrc/com/intellij/psi/NameUtilTest.java @@ -1,41 +1,62 @@ +/* + * Copyright 2000-2013 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.psi; -import junit.framework.TestCase; +import com.intellij.psi.codeStyle.NameUtil; +import org.junit.Test; import java.util.Arrays; -import com.intellij.psi.codeStyle.NameUtil; +import static org.junit.Assert.assertEquals; /** - * @author dsl + * @author dsl */ -public class PsiNameHelperTest extends TestCase { +public class NameUtilTest { + @Test public void testSplitIntoWords1() throws Exception { assertSplitEquals(new String[]{"I", "Base"}, "IBase"); } + @Test public void testSplitIntoWords2() throws Exception { assertSplitEquals(new String[]{"Order", "Index"}, "OrderIndex"); } + @Test public void testSplitIntoWords3() throws Exception { assertSplitEquals(new String[]{"order", "Index"}, "orderIndex"); } + @Test public void testSplitIntoWords4() throws Exception { assertSplitEquals(new String[]{"Order", "Index"}, "Order_Index"); } + @Test public void testSplitIntoWords5() throws Exception { assertSplitEquals(new String[]{"ORDER", "INDEX"}, "ORDER_INDEX"); } - + @Test public void testSplitIntoWords6() throws Exception { assertSplitEquals(new String[]{"gg", "J"}, "ggJ"); } - private void assertSplitEquals(String[] expected, String name) { + private static void assertSplitEquals(String[] expected, String name) { final String[] result = NameUtil.splitNameIntoWords(name); assertEquals(Arrays.asList(expected).toString(), Arrays.asList(result).toString()); }