<commit_before>package pl.iogreen.calindroid;

import android.widget.Button;
import android.widget.TextView;

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

import static org.junit.Assert.assertEquals;

@RunWith(RobolectricTestRunner.class)
public class CalindroidRoboTest {

    Calindroid injectedActivity;
    TextView injectedTextView;
    Button button;

    @Before
    public void setUp() {
        injectedActivity = Robolectric.buildActivity(Calindroid.class).create().get();
        injectedTextView = (TextView) injectedActivity.findViewById(R.id.someLabel);
        button = (Button) injectedActivity.findViewById(R.id.button);
    }

    @Test
    public void stringShouldEndInExclamationMark() {
        assertEquals(injectedTextView.getText(), "hello world");
        button.performClick();
        assertEquals(injectedTextView.getText(), "clicked");
    }

}
<commit_msg>Added mock for SomeService<commit_after>package pl.iogreen.calindroid;

import android.widget.Button;
import android.widget.TextView;

import com.google.inject.AbstractModule;
import com.google.inject.util.Modules;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;

import pl.iogreen.calindroid.service.SomeService;
import roboguice.RoboGuice;

import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.verify;

@RunWith(RobolectricTestRunner.class)
public class CalindroidRoboTest {

    private Calindroid injectedActivity;
    private TextView injectedTextView;
    private Button button;
    private SomeService someServiceMock = Mockito.mock(SomeService.class);

    @Before
    public void setUp() {
        RoboGuice.setBaseApplicationInjector(Robolectric.application, RoboGuice.DEFAULT_STAGE, Modules.override(RoboGuice.newDefaultRoboModule(Robolectric.application)).with(new MyTestModule()));

        injectedActivity = Robolectric.buildActivity(Calindroid.class).create().get();
        injectedTextView = (TextView) injectedActivity.findViewById(R.id.someLabel);
        button = (Button) injectedActivity.findViewById(R.id.button);
    }

    @Test
    public void stringShouldEndInExclamationMark() {
        assertEquals(injectedTextView.getText(), "hello world");
        button.performClick();
        assertEquals(injectedTextView.getText(), "clicked");

        verify(someServiceMock).execute();
    }

    private class MyTestModule extends AbstractModule {
        @Override
        protected void configure() {
            bind(SomeService.class).toInstance(someServiceMock);

        }
    }
}

{'fraction_non_alphanumeric': 0.0987078248384781, 'fraction_numerical': 0.0, 'mean_word_length': 4.4221789883268485, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4667993', 'n_tokens_mistral': 817, 'n_tokens_neox': 779, 'n_words': 140}