package kr.co.zumo.app.lifeplus.activity;

import android.os.Bundle;

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

import kr.co.zumo.app.lifeplus.view.presenter.Presenter;

@RunWith(RobolectricTestRunner.class)
public class ActivityBaseTest {

  @Test
  public void onBackPressed() {
    ActivityBase activity = Robolectric.setupActivity(TestAbstractActivity.class);
//
//    FragmentPresenter fragmentPresenter = mock(FragmentPresenter.class);
//    SuperModel.getInstance().setFragmentPresenter(fragmentPresenter);
//
//    activity.onBackPressed();
//
//    verify(fragmentPresenter).exitByBackKey();
//
//    MenuItem menuItem = mock(MenuItem.class);
//    when(menuItem.getItemId()).thenReturn(android.R.id.home);
//
//    activity.onOptionsItemSelected(menuItem);
//
//    verify(fragmentPresenter, new Times(2)).exitByBackKey();
//
//    when(menuItem.getItemId()).thenReturn(-1);
//
//    activity.onOptionsItemSelected(menuItem);
//    verify(fragmentPresenter, new Times(2)).exitByBackKey();
  }

  static class TestAbstractActivity extends ActivityBase {
    @Override
    void onAfterCreate(Bundle savedInstanceState) {

    }

    @Override
    void defineActionBar() {

    }

    @Override
    Presenter definePresenter() {
      return null;
    }

  }

}