<commit_before>package kapil.voiceassistedweatherapp;

import android.os.Bundle;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

import java.util.ArrayList;
import java.util.List;

import kapil.voiceassistedweatherapp.weather.OnWeatherDataReceivedListener;
import kapil.voiceassistedweatherapp.weather.models.WeatherData;
import kapil.voiceassistedweatherapp.witai.OnWitAiResponseListener;
import kapil.voiceassistedweatherapp.witai.models.Entities;
import kapil.voiceassistedweatherapp.witai.models.Intent;
import kapil.voiceassistedweatherapp.witai.models.WitAiResponse;

import static org.mockito.Mockito.verify;

/**
 * Created by Kapil on 29/01/17.
 */
@RunWith(MockitoJUnitRunner.class)
public class WeatherPresenterTest {
    @Mock
    private ViewDataProvider viewDataProvider;

    private WeatherPresenter weatherPresenter;
    private WitAiResponse witAiResponse;
    private WeatherData weatherData;

    @Before
    public void setUp() throws Exception {
        weatherPresenter = new WeatherPresenter(null, viewDataProvider);
    }

    @Test()
    public void listeningStateShouldBeTrueWhenSpeechRecognizerIsReady() throws Exception {
        weatherPresenter.onReadyForSpeech(Bundle.EMPTY);
        verify(viewDataProvider).onListeningStateChange(true);
    }

    @Test()
    public void listeningStateShouldBeFalseWhenSpeechRecognitionHasEnded() throws Exception {
        weatherPresenter.onEndOfSpeech();
        verify(viewDataProvider).onListeningStateChange(false);
    }

    @Test()
    public void listeningStateShouldBeFalseWhenSpeechRecognitionHasEndedWithError() throws Exception {
        weatherPresenter.onError(0);
        verify(viewDataProvider).onListeningStateChange(false);
    }

    @Test()<commit_msg>Change the way of weatherpresenter object initialization<commit_after>package kapil.voiceassistedweatherapp;

import android.content.Context;
import android.os.Bundle;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;

import java.util.ArrayList;
import java.util.List;

import javax.inject.Inject;

import kapil.voiceassistedweatherapp.weather.OnWeatherDataReceivedListener;
import kapil.voiceassistedweatherapp.weather.models.WeatherData;
import kapil.voiceassistedweatherapp.witai.OnWitAiResponseListener;
import kapil.voiceassistedweatherapp.witai.models.Entities;
import kapil.voiceassistedweatherapp.witai.models.Intent;
import kapil.voiceassistedweatherapp.witai.models.WitAiResponse;

import static org.mockito.Mockito.verify;

/**
 * Created by Kapil on 29/01/17.
 */
@RunWith(MockitoJUnitRunner.class)
public class WeatherPresenterTest {
    @Mock
    private ViewDataProvider viewDataProvider;

    @Mock
    private Context context;

    private WeatherPresenter weatherPresenter;
    private WitAiResponse witAiResponse;
    private WeatherData weatherData;

    @Before
    public void setUp() throws Exception {
        weatherPresenter = new WeatherPresenter(context, null);
        weatherPresenter.setViewDataProvider(viewDataProvider);
    }

    @Test()
    public void listeningStateShouldBeTrueWhenSpeechRecognizerIsReady() throws Exception {
        weatherPresenter.onReadyForSpeech(Bundle.EMPTY);
        verify(viewDataProvider).onListeningStateChange(true);
    }

    @Test()
    public void listeningStateShouldBeFalseWhenSpeechRecognitionHasEnded() throws Exception {
        weatherPresenter.onEndOfSpeech();
        verify(viewDataProvider).onListeningStateChange(false);
    }

    @Test()
    public void listeningStateShouldBeFalseWhenSpeechRecognitionHasEndedWithError() throws Exception {
        weatherPresenter.onError(0);
        verify(viewDataProvider).onListeningStateChange(false);
    }

    @Test()
{'fraction_non_alphanumeric': 0.07904737775525715, 'fraction_numerical': 0.00354699771978718, 'mean_word_length': 5.083204930662558, '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': '5397868', 'n_tokens_mistral': 1186, 'n_tokens_neox': 1147, 'n_words': 198}