package org.odk.collect.android.utilities;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.robolectric.RobolectricTestRunner;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;


@RunWith(RobolectricTestRunner.class)
public class TextUtilsTest {

    @Captor
    private ArgumentCaptor<String> captor;

    /**
     * Should return null if provided with null and not throw a NPE.
     */
    @Test
    public void textToHtml_BounceNullInput() {
        String input = null;
        CharSequence observed = TextUtils.textToHtml(input);
        assertNull(observed);
    }

    /**
     * Should do something not-null-ish if provided with non-null string.
     */
    @Test
    public void textToHtml_CallsHTMLOnRealInput() {
        String input = "This *bold* markdown is \n- nice,\n- efficient.\n";
        CharSequence result = TextUtils.textToHtml(input);
        assertNotNull(result);
    }
}

@@ -97,70 +97,8 @@
 th;%0A
-import org.mockito.ArgumentCaptor;%0Aimport org.mockito.Captor;%0A
 impo
@@ -303,64 +303,8 @@
  %7B%0A%0A
-    @Captor%0A    private ArgumentCaptor%3CString%3E captor;%0A%0A
     

remove now-ununsed argument captor