package io.github.hidroh.materialistic;

import android.content.Intent;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;

import static org.assertj.android.api.Assertions.assertThat;

@RunWith(RobolectricTestRunner.class)
public class AppUtilsTest {
    @Test
    public void testMakeShareIntent() {
        Intent actual = AppUtils.makeShareIntent("content");
        assertThat(actual).hasAction(Intent.ACTION_SEND);
        assertThat(actual).hasType("text/plain");
        assertThat(actual).hasExtra(Intent.EXTRA_TEXT);
    }
}

@@ -64,16 +64,81 @@
 .Intent;
+%0Aimport android.view.MotionEvent;%0Aimport android.widget.TextView;
 %0A%0Aimport
@@ -237,409 +237,1634 @@
 er;%0A
-%0Aimport static org.assertj.android.api.Assertions.assertThat;%0A%0A@RunWith(RobolectricTestRunner.class)%0Apublic class AppUtilsTest %7B%0A    @Test%0A    public void testMakeShareIntent() %7B%0A        Intent actual = AppUtils.makeShareIntent(%22content%22);%0A        assertThat(actual).hasAction(Intent.ACTION_SEND);%0A        assertThat(actual).hasType(%22text/plain%22);%0A        assertThat(actual).hasExtra(Intent.EXTRA_TEXT
+import org.robolectric.RuntimeEnvironment;%0Aimport org.robolectric.shadows.ShadowApplication;%0A%0Aimport static junit.framework.Assert.assertNotNull;%0Aimport static junit.framework.Assert.assertTrue;%0Aimport static org.assertj.android.api.Assertions.assertThat;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.when;%0Aimport static org.robolectric.Shadows.shadowOf;%0A%0A@RunWith(RobolectricTestRunner.class)%0Apublic class AppUtilsTest %7B%0A    @Test%0A    public void testMakeShareIntent() %7B%0A        Intent actual = AppUtils.makeShareIntent(%22content%22);%0A        assertThat(actual).hasAction(Intent.ACTION_SEND);%0A        assertThat(actual).hasType(%22text/plain%22);%0A        assertThat(actual).hasExtra(Intent.EXTRA_TEXT);%0A    %7D%0A%0A    @Test%0A    public void testSetTextWithLinks() %7B%0A        TextView textView = new TextView(RuntimeEnvironment.application);%0A        AppUtils.setTextWithLinks(textView, %22%3Ca href=%5C%5C%5C%22http://www.justin.tv/problems/bml%5C%5C%5C%22 rel=%5C%5C%5C%22nofollow%5C%5C%5C%22%3Ehttp://www.justin.tv/problems/bml%3C/a%3E%22);%0A        MotionEvent event = mock(MotionEvent.class);%0A        when(event.getAction()).thenReturn(MotionEvent.ACTION_DOWN);%0A        when(event.getX()).thenReturn(0f);%0A        when(event.getY()).thenReturn(0f);%0A        assertTrue(shadowOf(textView).getOnTouchListener().onTouch(textView, event));%0A        when(event.getAction()).thenReturn(MotionEvent.ACTION_UP);%0A        when(event.getX()).thenReturn(0f);%0A        when(event.getY()).thenReturn(0f);%0A        assertTrue(shadowOf(textView).getOnTouchListener().onTouch(textView, event));%0A        assertNotNull(ShadowApplication.getInstance().getNextStartedActivity()
 );%0A 

Add app utils test