// Path: demo/src/main/java/it/cosenonjaviste/demomv2m/core/MessageManager.java
// public interface MessageManager {
//     void showMessage(ActivityHolder activityHolder, int message);
// }
// 
// Path: mv2m/src/main/java/it/cosenonjaviste/mv2m/ActivityHolder.java
// public class ActivityHolder {
// 
//     private ViewModelContainer<?> viewModelContainer;
// 
//     public void setViewModelContainer(ViewModelContainer<?> viewModelContainer) {
//         this.viewModelContainer = viewModelContainer;
//     }
// 
//     public Activity getActivity() {
//         return viewModelContainer.getActivity();
//     }
// 
//     public void startActivity(Intent intent) {
//         viewModelContainer.startActivity(intent);
//     }
// 
//     public void startActivityForResult(Intent intent, int requestCode) {
//         viewModelContainer.startActivityForResult(intent, requestCode);
//     }
// 
//     public void finishActivity() {
//         Activity activity = getActivity();
//         if (activity != null) {
//             activity.finish();
//         }
//     }
// 
//     public void finishActivity(ActivityResult result) {
//         Activity activity = getActivity();
//         if (activity != null) {
//             Intent intent = new Intent();
//             intent.putExtra(ViewModelManager.RESULT_DATA, result.getData());
//             activity.setResult(result.isResultOk() ? Activity.RESULT_OK : Activity.RESULT_CANCELED, intent);
//             activity.finish();
//         }
//     }
// 
//     public <ARG, VM extends ViewModel<ARG, ?>, F extends ViewModelFragment<VM>> F instantiateFragment(Class<F> cls, ARG argument) {
//         return ArgumentManager.instantiateFragment(getActivity(), cls, argument);
//     }
// 
//     public <ARG, VM extends ViewModel<ARG, ?>, A extends ViewModelActivity<VM>> void startActivity(Class<A> cls, ARG argument) {
//         Activity activity = getActivity();
//         if (activity != null) {
//             activity.startActivity(ArgumentManager.createIntent(activity, cls, argument));
//         }
//     }
// 
//     public <ARG, VM extends ViewModel<ARG, ?>, A extends ViewModelActivity<VM>> void startActivityForResult(Class<A> cls, int requestCode, ARG argument) {
//         Activity activity = getActivity();
//         if (activity != null) {
//             activity.startActivityForResult(ArgumentManager.createIntent(activity, cls, argument), requestCode);
//         }
//     }
// }


import static org.mockito.Mockito.when;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import it.cosenonjaviste.demomv2m.R;
import it.cosenonjaviste.demomv2m.core.MessageManager;
import it.cosenonjaviste.mv2m.ActivityHolder;
import rx.Observable;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.verify;
/*
 *  Copyright 2015 Fabio Collini.
 *
 * 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 it.cosenonjaviste.demomv2m.core.currencyconverter4;




@RunWith(MockitoJUnitRunner.class)
public class CurrencyConverterViewModelTest {
    @Mock RateLoader rateLoader;

    @Mock MessageManager messageManager;

    @InjectMocks CurrencyConverterViewModel viewModel;

    @Test
// Path: demo/src/main/java/it/cosenonjaviste/demomv2m/core/MessageManager.java
// public interface MessageManager {
//     void showMessage(ActivityHolder activityHolder, int message);
// }
// 
// Path: mv2m/src/main/java/it/cosenonjaviste/mv2m/ActivityHolder.java
// public class ActivityHolder {
// 
//     private ViewModelContainer<?> viewModelContainer;
// 
//     public void setViewModelContainer(ViewModelContainer<?> viewModelContainer) {
//         this.viewModelContainer = viewModelContainer;
//     }
// 
//     public Activity getActivity() {
//         return viewModelContainer.getActivity();
//     }
// 
//     public void startActivity(Intent intent) {
//         viewModelContainer.startActivity(intent);
//     }
// 
//     public void startActivityForResult(Intent intent, int requestCode) {
//         viewModelContainer.startActivityForResult(intent, requestCode);
//     }
// 
//     public void finishActivity() {
//         Activity activity = getActivity();
//         if (activity != null) {
//             activity.finish();
//         }
//     }
// 
//     public void finishActivity(ActivityResult result) {
//         Activity activity = getActivity();
//         if (activity != null) {
//             Intent intent = new Intent();
//             intent.putExtra(ViewModelManager.RESULT_DATA, result.getData());
//             activity.setResult(result.isResultOk() ? Activity.RESULT_OK : Activity.RESULT_CANCELED, intent);
//             activity.finish();
//         }
//     }
// 
//     public <ARG, VM extends ViewModel<ARG, ?>, F extends ViewModelFragment<VM>> F instantiateFragment(Class<F> cls, ARG argument) {
//         return ArgumentManager.instantiateFragment(getActivity(), cls, argument);
//     }
// 
//     public <ARG, VM extends ViewModel<ARG, ?>, A extends ViewModelActivity<VM>> void startActivity(Class<A> cls, ARG argument) {
//         Activity activity = getActivity();
//         if (activity != null) {
//             activity.startActivity(ArgumentManager.createIntent(activity, cls, argument));
//         }
//     }
// 
//     public <ARG, VM extends ViewModel<ARG, ?>, A extends ViewModelActivity<VM>> void startActivityForResult(Class<A> cls, int requestCode, ARG argument) {
//         Activity activity = getActivity();
//         if (activity != null) {
//             activity.startActivityForResult(ArgumentManager.createIntent(activity, cls, argument), requestCode);
//         }
//     }
// }


// Path: demo/src/test/java/it/cosenonjaviste/demomv2m/core/currencyconverter4/CurrencyConverterViewModelTest.java
import static org.mockito.Mockito.when;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import it.cosenonjaviste.demomv2m.R;
import it.cosenonjaviste.demomv2m.core.MessageManager;
import it.cosenonjaviste.mv2m.ActivityHolder;
import rx.Observable;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.verify;

/*
 *  Copyright 2015 Fabio Collini.
 *
 * 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 it.cosenonjaviste.demomv2m.core.currencyconverter4;




@RunWith(MockitoJUnitRunner.class)
public class CurrencyConverterViewModelTest {
    @Mock RateLoader rateLoader;

    @Mock MessageManager messageManager;

    @InjectMocks CurrencyConverterViewModel viewModel;

    @Test
    public void testConvertCurrency() {