package io.github.plastix.forage.util;

public class ActivityUtilsTest {
}

@@ -37,39 +37,3059 @@
 l;%0A%0A
-public class ActivityUtilsTest %7B
+import android.content.Intent;%0Aimport android.support.annotation.StringRes;%0Aimport android.support.v7.app.ActionBar;%0Aimport android.support.v7.app.AppCompatActivity;%0Aimport android.support.v7.app.AppCompatDelegate;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Ignore;%0Aimport org.junit.Test;%0A%0Aimport static com.google.common.truth.Truth.assertThat;%0Aimport static org.mockito.Mockito.atLeastOnce;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.times;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0Apublic class ActivityUtilsTest %7B%0A%0A    private AppCompatActivity activity;%0A%0A    @Before%0A    public void beforeEachTest() %7B%0A        activity = mock(AppCompatActivity.class);%0A    %7D%0A%0A    @Ignore(%22Roboelectric Problems%22)%0A    @Test%0A    public void getApplicationSettingsIntent_hasCorrectIntentData() %7B%0A        when(activity.getPackageName()).thenReturn(%22FakeActivity%22);%0A        String uri_string = %22package:%22 + activity.getPackageName();%0A        Intent intent = ActivityUtils.getApplicationSettingsIntent(activity);%0A%0A        assertThat(intent.getDataString()).isEqualTo(uri_string);%0A        assertThat(intent.getAction()).isEqualTo(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);%0A    %7D%0A%0A    @Test%0A    public void setSupportActionBarTitle_setStringTitleHasActionBar() %7B%0A        String title = %22title%22;%0A        ActionBar actionBar = mock(ActionBar.class);%0A        when(activity.getSupportActionBar()).thenReturn(actionBar);%0A%0A        ActivityUtils.setSupportActionBarTitle(activity, title);%0A%0A        verify(activity, times(1)).getSupportActionBar();%0A        verify(actionBar, times(1)).setTitle(title);%0A    %7D%0A%0A    @Test%0A    public void setSupportActionBarTitle_noActionBar() %7B%0A        String title = %22title%22;%0A        when(activity.getSupportActionBar()).thenReturn(null);%0A%0A        ActivityUtils.setSupportActionBarTitle(activity, title);%0A%0A        verify(activity, times(1)).getSupportActionBar();%0A    %7D%0A%0A    @Test%0A    public void setSupportActionBarTitle_stringResID() %7B%0A        String title = %22title%22;%0A        @StringRes int fakeId = 0;%0A        when(activity.getString(fakeId)).thenReturn(title);%0A        ActionBar actionBar = mock(ActionBar.class);%0A        when(activity.getSupportActionBar()).thenReturn(actionBar);%0A%0A        ActivityUtils.setSupportActionBarTitle(activity, fakeId);%0A%0A        verify(activity, times(1)).getString(fakeId);%0A        verify(activity, times(1)).getSupportActionBar();%0A        verify(actionBar, times(1)).setTitle(title);%0A    %7D%0A%0A    @Test%0A    public void setSupportActionBarBack_setBackButtonEnabled() %7B%0A        AppCompatDelegate delegate = mock(AppCompatDelegate.class);%0A        ActionBar actionBar = mock(ActionBar.class);%0A        when(delegate.getSupportActionBar()).thenReturn(actionBar);%0A%0A        ActivityUtils.setSupportActionBarBack(delegate);%0A%0A        verify(delegate, atLeastOnce()).getSupportActionBar();%0A        verify(actionBar, times(1)).setDisplayShowHomeEnabled(true);%0A        verify(actionBar, times(1)).setDisplayHomeAsUpEnabled(true);%0A    %7D
 %0A%7D%0A

Add ActivityUtils unit tests