package com.github.aureliano.almamater.core.helper;

import junit.framework.Assert;

import org.junit.Test;

public class StringHelperTest {

	@Test
	public void testIsEmpty() {
		Assert.assertTrue(StringHelper.isEmpty(null));
		Assert.assertTrue(StringHelper.isEmpty(""));
		Assert.assertFalse(StringHelper.isEmpty("text"));
	}
	
	@Test
	public void testToString() {
		Assert.assertEquals("null", StringHelper.toString(null));
		Assert.assertEquals("text", StringHelper.toString("text"));
		Assert.assertEquals("23", StringHelper.toString(23));
	}
	
	@Test
	public void testParse() {
		Assert.assertEquals("30", StringHelper.parse(30));
		Assert.assertEquals("", StringHelper.parse(""));
		Assert.assertNull(StringHelper.parse(null));
	}
	
	@Test
	public void testCapitalize() {
		Assert.assertEquals("House", StringHelper.capitalize("house"));
		Assert.assertEquals("House", StringHelper.capitalize("HOUSE"));
		Assert.assertEquals("House", StringHelper.capitalize("HoUSE"));
		Assert.assertEquals("House of torments", StringHelper.capitalize("house OF tormentS"));
	}
	
	@Test
	public void testJoin() {
		Assert.assertEquals("12345", StringHelper.join(new Object[] {1, 2, 3, 4, 5}));
		Assert.assertEquals("1, 2, 3, 4, 5", StringHelper.join(new Object[] {1, 2, 3, 4, 5}, ", "));
	}
	
	@Test
	public void testIsNumeric() {
		Assert.assertTrue(StringHelper.isNumeric("1"));
		Assert.assertTrue(StringHelper.isNumeric("45"));
		Assert.assertTrue(StringHelper.isNumeric("-54"));
		Assert.assertTrue(StringHelper.isNumeric("+54"));
		Assert.assertTrue(StringHelper.isNumeric("25.97854"));
		Assert.assertTrue(StringHelper.isNumeric("-3365.8787"));
		Assert.assertTrue(StringHelper.isNumeric("+3365.8787"));
	}
}
@@ -78,16 +78,148 @@
 ssert;%0A%0A
+import static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertNull;%0Aimport static org.junit.Assert.assertTrue;%0A%0A
 import o
@@ -491,31 +491,24 @@
 tring() %7B%0A%09%09
-Assert.
 assertEquals
@@ -544,31 +544,24 @@
 g(null));%0A%09%09
-Assert.
 assertEquals
@@ -599,31 +599,24 @@
 %22text%22));%0A%09%09
-Assert.
 assertEquals
@@ -683,39 +683,32 @@
 testParse() %7B%0A%09%09
-Assert.
 assertEquals(%2230
@@ -733,31 +733,24 @@
 rse(30));%0A%09%09
-Assert.
 assertEquals
@@ -777,31 +777,24 @@
 rse(%22%22));%0A%09%09
-Assert.
 assertNull(S
@@ -861,31 +861,24 @@
 alize() %7B%0A%09%09
-Assert.
 assertEquals
@@ -920,31 +920,24 @@
 house%22));%0A%09%09
-Assert.
 assertEquals
@@ -975,39 +975,32 @@
 ze(%22HOUSE%22));%0A%09%09
-Assert.
 assertEquals(%22Ho
@@ -1038,31 +1038,24 @@
 HoUSE%22));%0A%09%09
-Assert.
 assertEquals
@@ -1159,31 +1159,24 @@
 tJoin() %7B%0A%09%09
-Assert.
 assertEquals
@@ -1233,31 +1233,24 @@
  4, 5%7D));%0A%09%09
-Assert.
 assertEquals
@@ -1364,31 +1364,24 @@
 meric() %7B%0A%09%09
-Assert.
 assertTrue(S
@@ -1407,31 +1407,24 @@
 ic(%221%22));%0A%09%09
-Assert.
 assertTrue(S
@@ -1451,31 +1451,24 @@
 c(%2245%22));%0A%09%09
-Assert.
 assertTrue(S
@@ -1492,39 +1492,32 @@
 eric(%22-54%22));%0A%09%09
-Assert.
 assertTrue(Strin
@@ -1537,39 +1537,32 @@
 eric(%22+54%22));%0A%09%09
-Assert.
 assertTrue(Strin
@@ -1591,31 +1591,24 @@
 97854%22));%0A%09%09
-Assert.
 assertTrue(S
@@ -1643,31 +1643,24 @@
 .8787%22));%0A%09%09
-Assert.
 assertTrue(S

Use static imports.