aboutsummaryrefslogtreecommitdiff
path: root/WordPress/src/androidTest/java/org/wordpress/android/util/UrlUtilsTest.java
blob: 25398b9d40e091e6c4c567ada8b27f007acb47f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package org.wordpress.android.util;

import android.test.InstrumentationTestCase;

public class UrlUtilsTest extends InstrumentationTestCase {
    public void testGetHost1() {
        assertEquals("a.com", UrlUtils.getHost("http://a.com/test"));
    }

    public void testGetHost2() {
        assertEquals("a.com", UrlUtils.getHost("http://a.com#.b.com/test"));
    }

    public void testGetHost3() {
        assertEquals("a.com", UrlUtils.getHost("https://a.com"));
    }

    public void testGetHost4() {
        assertEquals("a.com", UrlUtils.getHost("https://a.com/test#test"));
    }

    public void testGetHost5() {
        assertEquals("", UrlUtils.getHost("a.com"));
    }
}