X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Feu%2Fsvjatoslav%2Fcommons%2Fstring%2FString2Test.java;h=35e203b037b1d9c16ece02c66b396e01d7b0c564;hb=6846681d727a07385bcd3e0eb856f70a7e96448c;hp=f13d0d2d67290ba361cdfbdb1e0e01b955001ec5;hpb=a10b74a05e9aecc78e1e983025d1933b91e076da;p=svjatoslav_commons.git diff --git a/src/test/java/eu/svjatoslav/commons/string/String2Test.java b/src/test/java/eu/svjatoslav/commons/string/String2Test.java index f13d0d2..35e203b 100755 --- a/src/test/java/eu/svjatoslav/commons/string/String2Test.java +++ b/src/test/java/eu/svjatoslav/commons/string/String2Test.java @@ -1,6 +1,6 @@ /* * Svjatoslav Commons - shared library of common functionality. - * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Copyright ©2012-2017, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License @@ -9,41 +9,41 @@ package eu.svjatoslav.commons.string; -import static org.junit.Assert.assertEquals; - import org.junit.Test; +import static org.junit.Assert.assertEquals; + public class String2Test { - @Test - public void testCutLeft() { + @Test + public void testCutLeft() { - final String2 s = new String2("this is a test"); + final String2 s = new String2("this is a test"); - assertEquals("this ", s.cutLeft(5)); - assertEquals("is ", s.cutLeft(3)); - assertEquals("a ", s.cutLeft(2)); - assertEquals("test", s.cutLeft(25)); - assertEquals("", s.cutLeft(5)); + assertEquals("this ", s.trimLeft(5)); + assertEquals("is ", s.trimLeft(3)); + assertEquals("a ", s.trimLeft(2)); + assertEquals("test", s.trimLeft(25)); + assertEquals("", s.trimLeft(5)); - } + } - @Test - public void testEnforceLength() { - final String2 s = new String2("12345678"); - s.enforceLength(3); - assertEquals("123", s.toString()); + @Test + public void testEnforceLength() { + final String2 s = new String2("12345678"); + s.enforceLength(3); + assertEquals("123", s.toString()); - s.enforceLength(5); - assertEquals("123 ", s.toString()); - } + s.enforceLength(5); + assertEquals("123 ", s.toString()); + } - @Test - public void testSuffexAndPrefix() { - final String2 s = new String2("experiment"); - s.addPrefix("The ").addSuffix(" !"); + @Test + public void testSuffixAndPrefix() { + final String2 s = new String2("experiment"); + s.addPrefix("The ").addSuffix(" !"); - assertEquals("The experiment !", s.toString()); - } + assertEquals("The experiment !", s.toString()); + } }