package com.couchbase.cblite.replicator;

import android.test.InstrumentationTestCase;

import junit.framework.Assert;

import java.net.URL;

public class TestReplicator extends InstrumentationTestCase {

    public void testBuildRelativeURLString() throws Exception {

        String dbUrlString = "http://10.0.0.3:4984/todos/";
        CBLReplicator replicator = new CBLPusher(null, new URL(dbUrlString), false, null);
        String relativeUrlString = replicator.buildRelativeURLString("_facebook");

        String expected = "http://10.0.0.3:4984/todos/_facebook";
        Assert.assertEquals(expected, relativeUrlString);
    }

}

@@ -484,25 +484,19 @@
 String(%22
-_faceb
+f
 oo
-k
 %22);%0A%0A   
@@ -550,17 +550,448 @@
 dos/
-_facebook
+foo%22;%0A        Assert.assertEquals(expected, relativeUrlString);%0A%0A    %7D%0A%0A    public void testBuildRelativeURLStringWithLeadingSlash() throws Exception %7B%0A%0A        String dbUrlString = %22http://10.0.0.3:4984/todos/%22;%0A        CBLReplicator replicator = new CBLPusher(null, new URL(dbUrlString), false, null);%0A        String relativeUrlString = replicator.buildRelativeURLString(%22/foo%22);%0A%0A        String expected = %22http://10.0.0.3:4984/todos/foo
 %22;%0A 
@@ -1047,16 +1047,17 @@
 tring);%0A
+%0A
     %7D%0A%0A%7D

enhance unit test for issue #87