summaryrefslogtreecommitdiff
path: root/app/src/androidTest/java/de/test/antennapod/util/URIUtilTest.java
blob: 7bdcfb89889ec4d707091b0db2c62f2a0bde4d0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package de.test.antennapod.util;

import android.test.AndroidTestCase;
import de.danoeh.antennapod.core.util.URIUtil;

/**
 * Test class for URIUtil
 */
public class URIUtilTest extends AndroidTestCase {

    public void testGetURIFromRequestUrlShouldNotEncode() {
        final String testUrl = "http://example.com/this%20is%20encoded";
        assertEquals(testUrl, URIUtil.getURIFromRequestUrl(testUrl).toString());
    }

    public void testGetURIFromRequestUrlShouldEncode() {
        final String testUrl = "http://example.com/this is not encoded";
        final String expected = "http://example.com/this%20is%20not%20encoded";
        assertEquals(expected, URIUtil.getURIFromRequestUrl(testUrl).toString());
    }
}