AndroidAPS/app/src/test/java/info/nightscout/androidaps/utils/StringUtilsTest.java

23 lines
876 B
Java
Raw Normal View History

2019-02-26 20:38:27 +01:00
package info.nightscout.androidaps.utils;
2018-06-23 21:36:18 +02:00
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class StringUtilsTest {
@Test
public void removeSurroundingQuotesTest() {
String compareString = "test";
assertEquals(compareString, StringUtils.removeSurroundingQuotes(compareString));
assertEquals(compareString, StringUtils.removeSurroundingQuotes("\"" + compareString + "\""));
assertEquals("\"" + compareString, StringUtils.removeSurroundingQuotes("\"" + compareString));
compareString = "te\"st";
assertEquals(compareString, StringUtils.removeSurroundingQuotes(compareString));
assertEquals(compareString, StringUtils.removeSurroundingQuotes("\"" + compareString + "\""));
assertEquals("\"" + compareString, StringUtils.removeSurroundingQuotes("\"" + compareString));
}
}