// Path: mvvmapp/src/main/java/com/hibrianlee/mvvmapp/viewmodel/ViewModel.java
// public abstract class ViewModel extends BaseObservable {
// 
//     @Inject
//     @AppContext
//     protected Context appContext;
// 
//     @Inject
//     protected AttachedActivity attachedActivity;
// 
//     protected ViewModel(@NonNull ActivityComponent activityComponent,
//                         @Nullable State savedInstanceState) {
//         activityComponent.inject(this);
//     }
// 
//     @CallSuper
//     public void onStart() {
// 
//     }
// 
//     public State getInstanceState() {
//         return new State(this);
//     }
// 
//     @CallSuper
//     public void onStop() {
// 
//     }
// 
//     public static class State implements Parcelable {
// 
//         protected State(ViewModel viewModel) {
// 
//         }
// 
//         public State(Parcel in) {
// 
//         }
// 
//         @Override
//         public int describeContents() {
//             return 0;
//         }
// 
//         @CallSuper
//         @Override
//         public void writeToParcel(Parcel dest, int flags) {
// 
//         }
// 
//         public static Creator<State> CREATOR = new Creator<State>() {
//             @Override
//             public State createFromParcel(Parcel source) {
//                 return new State(source);
//             }
// 
//             @Override
//             public State[] newArray(int size) {
//                 return new State[size];
//             }
//         };
//     }
// }
// 
// Path: sample/src/main/java/com/hibrianlee/sample/mvvm/activity/AndroidVersionsActivity.java
// public class AndroidVersionsActivity extends BaseActivity {
// 
//     private static final String TAG_VERSIONS_FRAGMENT = "versionsFragment";
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_android_versions);
// 
//         FragmentManager fm = getSupportFragmentManager();
//         Fragment fragment = fm.findFragmentByTag(TAG_VERSIONS_FRAGMENT);
//         if (fragment == null) {
//             fragment = new AndroidVersionsFragment();
//             fm.beginTransaction()
//                     .add(R.id.fragmentContainer, fragment, TAG_VERSIONS_FRAGMENT)
//                     .commit();
//         }
//     }
// }
// 
// Path: sample/src/main/java/com/hibrianlee/sample/mvvm/activity/ClickCountActivity.java
// public class ClickCountActivity extends BaseActivity {
// 
//     private ClickCountViewModel clickCountViewModel;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         ActivityClickCountBinding binding =
//                 DataBindingUtil.setContentView(this, R.layout.activity_click_count);
//         binding.setViewModel(clickCountViewModel);
//         ButterKnife.bind(this);
//     }
// 
//     @Nullable
//     @Override
//     protected ViewModel createViewModel(@Nullable ViewModel.State savedViewModelState) {
//         clickCountViewModel = viewModelFactory.createClickCountViewModel(getActivityComponent(),
//                 savedViewModelState);
//         return clickCountViewModel;
//     }
// 
//     @OnClick(R.id.clickButton)
//     void onClickButton() {
//         clickCountViewModel.onClickButton();
//     }
// 
//     @OnClick(R.id.hiBrianLee)
//     void onClickHiBrianLee() {
//         clickCountViewModel.onClickHiBrianLee();
//     }
// }


import com.hibrianlee.mvvmapp.viewmodel.ViewModel;
import com.hibrianlee.sample.mvvm.R;
import com.hibrianlee.sample.mvvm.activity.AndroidVersionsActivity;
import com.hibrianlee.sample.mvvm.activity.ClickCountActivity;
import org.junit.Test;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
/*
 * Copyright (C) 2015 Brian Lee (@hiBrianLee)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.hibrianlee.sample.mvvm.viewmodel;




public class MainViewModelTest extends ViewModelTest<MainViewModel> {

    @Override
    protected MainViewModel createViewModel(ViewModel.State savedInstanceState) {
        return new MainViewModel(testComponent, null);
    }

    @Test
    public void testOnClickButtonClicks() {
        viewModel.onClickButtonClicks();
        verify(attachedActivity).startActivity(ClickCountActivity.class);
    }

    @Test
    public void testOnClickButtonRecyclerView() {
        viewModel.onClickButtonRecyclerView();
// Path: mvvmapp/src/main/java/com/hibrianlee/mvvmapp/viewmodel/ViewModel.java
// public abstract class ViewModel extends BaseObservable {
// 
//     @Inject
//     @AppContext
//     protected Context appContext;
// 
//     @Inject
//     protected AttachedActivity attachedActivity;
// 
//     protected ViewModel(@NonNull ActivityComponent activityComponent,
//                         @Nullable State savedInstanceState) {
//         activityComponent.inject(this);
//     }
// 
//     @CallSuper
//     public void onStart() {
// 
//     }
// 
//     public State getInstanceState() {
//         return new State(this);
//     }
// 
//     @CallSuper
//     public void onStop() {
// 
//     }
// 
//     public static class State implements Parcelable {
// 
//         protected State(ViewModel viewModel) {
// 
//         }
// 
//         public State(Parcel in) {
// 
//         }
// 
//         @Override
//         public int describeContents() {
//             return 0;
//         }
// 
//         @CallSuper
//         @Override
//         public void writeToParcel(Parcel dest, int flags) {
// 
//         }
// 
//         public static Creator<State> CREATOR = new Creator<State>() {
//             @Override
//             public State createFromParcel(Parcel source) {
//                 return new State(source);
//             }
// 
//             @Override
//             public State[] newArray(int size) {
//                 return new State[size];
//             }
//         };
//     }
// }
// 
// Path: sample/src/main/java/com/hibrianlee/sample/mvvm/activity/AndroidVersionsActivity.java
// public class AndroidVersionsActivity extends BaseActivity {
// 
//     private static final String TAG_VERSIONS_FRAGMENT = "versionsFragment";
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(R.layout.activity_android_versions);
// 
//         FragmentManager fm = getSupportFragmentManager();
//         Fragment fragment = fm.findFragmentByTag(TAG_VERSIONS_FRAGMENT);
//         if (fragment == null) {
//             fragment = new AndroidVersionsFragment();
//             fm.beginTransaction()
//                     .add(R.id.fragmentContainer, fragment, TAG_VERSIONS_FRAGMENT)
//                     .commit();
//         }
//     }
// }
// 
// Path: sample/src/main/java/com/hibrianlee/sample/mvvm/activity/ClickCountActivity.java
// public class ClickCountActivity extends BaseActivity {
// 
//     private ClickCountViewModel clickCountViewModel;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         ActivityClickCountBinding binding =
//                 DataBindingUtil.setContentView(this, R.layout.activity_click_count);
//         binding.setViewModel(clickCountViewModel);
//         ButterKnife.bind(this);
//     }
// 
//     @Nullable
//     @Override
//     protected ViewModel createViewModel(@Nullable ViewModel.State savedViewModelState) {
//         clickCountViewModel = viewModelFactory.createClickCountViewModel(getActivityComponent(),
//                 savedViewModelState);
//         return clickCountViewModel;
//     }
// 
//     @OnClick(R.id.clickButton)
//     void onClickButton() {
//         clickCountViewModel.onClickButton();
//     }
// 
//     @OnClick(R.id.hiBrianLee)
//     void onClickHiBrianLee() {
//         clickCountViewModel.onClickHiBrianLee();
//     }
// }


// Path: sample/src/test/java/com/hibrianlee/sample/mvvm/viewmodel/MainViewModelTest.java
import com.hibrianlee.mvvmapp.viewmodel.ViewModel;
import com.hibrianlee.sample.mvvm.R;
import com.hibrianlee.sample.mvvm.activity.AndroidVersionsActivity;
import com.hibrianlee.sample.mvvm.activity.ClickCountActivity;
import org.junit.Test;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

/*
 * Copyright (C) 2015 Brian Lee (@hiBrianLee)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.hibrianlee.sample.mvvm.viewmodel;




public class MainViewModelTest extends ViewModelTest<MainViewModel> {

    @Override
    protected MainViewModel createViewModel(ViewModel.State savedInstanceState) {
        return new MainViewModel(testComponent, null);
    }

    @Test
    public void testOnClickButtonClicks() {
        viewModel.onClickButtonClicks();
        verify(attachedActivity).startActivity(ClickCountActivity.class);
    }

    @Test
    public void testOnClickButtonRecyclerView() {
        viewModel.onClickButtonRecyclerView();
        verify(attachedActivity).startActivity(AndroidVersionsActivity.class);