package seedu.address.commons.util;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

import java.io.FileNotFoundException;

import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class StringUtilTest {

    @Rule
    public ExpectedException thrown = ExpectedException.none();

    @Test
    public void isUnsignedPositiveInteger() {
        assertFalse(StringUtil.isUnsignedInteger(null));
        assertFalse(StringUtil.isUnsignedInteger(""));
        assertFalse(StringUtil.isUnsignedInteger("a"));
        assertFalse(StringUtil.isUnsignedInteger("aaa"));
        assertFalse(StringUtil.isUnsignedInteger("  "));
        assertFalse(StringUtil.isUnsignedInteger("-1"));
        assertFalse(StringUtil.isUnsignedInteger("0"));
        assertFalse(StringUtil.isUnsignedInteger("+1")); //should be unsigned
        assertFalse(StringUtil.isUnsignedInteger("-1")); //should be unsigned
        assertFalse(StringUtil.isUnsignedInteger(" 10")); //should not contain whitespaces
        assertFalse(StringUtil.isUnsignedInteger("10 ")); //should not contain whitespaces
        assertFalse(StringUtil.isUnsignedInteger("1 0")); //should not contain whitespaces

        assertTrue(StringUtil.isUnsignedInteger("1"));
        assertTrue(StringUtil.isUnsignedInteger("10"));
    }

    @Test
    public void getDetails_exceptionGiven(){
        assertThat(StringUtil.getDetails(new FileNotFoundException("file not found")),
                   containsString("java.io.FileNotFoundException: file not found"));
    }

    @Test
    public void getDetails_nullGiven_assertionError(){
        thrown.expect(AssertionError.class);
        StringUtil.getDetails(null);
    }


}

@@ -516,16 +516,56 @@
 eger() %7B
+%0A%0A        // Equivalence partition: null
 %0A       
@@ -613,16 +613,46 @@
 (null));
+%0A%0A        // EP: empty strings
 %0A       
@@ -694,24 +694,127 @@
 nteger(%22%22));
+ //boundary value%0A        assertFalse(StringUtil.isUnsignedInteger(%22  %22));%0A%0A        // EP: not a number
 %0A        ass
@@ -912,32 +912,33 @@
 er(%22aaa%22));%0A
+%0A
         
 assertFalse(
@@ -929,56 +929,19 @@
     
-assertFalse(StringUtil.isUnsignedInteger(%22  %22));
+// EP: zero
 %0A   
@@ -991,23 +991,23 @@
 er(%22
--1
+0
 %22));%0A
+%0A
         
 asse
@@ -1006,55 +1006,29 @@
     
-assertFalse(StringUtil.isUnsignedInteger(%220%22));
+// EP: signed numbers
 %0A   
@@ -1078,35 +1078,14 @@
 er(%22
-+
+-
 1%22));
- //should be unsigned
 %0A   
@@ -1135,35 +1135,55 @@
 er(%22
--
++
 1%22));
- //should be unsigned
+%0A%0A        // EP: numbers with white space
 %0A   
@@ -1240,41 +1240,8 @@
 %22));
- //should not contain whitespaces
 %0A   
@@ -1298,41 +1298,8 @@
 %22));
- //should not contain whitespaces
 %0A   
@@ -1356,42 +1356,58 @@
 %22));
- //should not contain whitespaces%0A
+%0A%0A        // EP: valid numbers, should return true
 %0A   
@@ -1453,24 +1453,41 @@
 teger(%221%22));
+ //boundary value
 %0A        ass

Add test case design info to StringUtilTest::isUnsignedPositiveInteger