// Path: mvvm-life-cycle/src/main/java/me/henrytao/mvvmlifecycle/event/Event1.java
// public class Event1<T> implements Event {
// 
//   private static final int LENGTH = 1;
// 
//   private final Listener<T> mListener;
// 
//   public Event1(Listener<T> listener) {
//     mListener = listener;
//   }
// 
//   @SuppressWarnings("unchecked")
//   @Override
//   public void call(Object o) {
//     if (mListener != null && o instanceof Object[]) {
//       Object[] objects = (Object[]) o;
//       if (objects.length == LENGTH) {
//         mListener.onEventTrigger((T) objects[0]);
//         return;
//       }
//       throw new InvalidParams(String.format(Locale.US, "Required %d. Found %d", LENGTH, objects.length));
//     }
//   }
// 
//   public interface Listener<T> {
// 
//     void onEventTrigger(T data);
//   }
// }
// 
// Path: sample/src/main/java/me/henrytao/mvvmlifecycledemo/data/model/Task.java
// public class Task {
// 
//   private boolean mCompleted;
// 
//   private String mDescription;
// 
//   private String mId;
// 
//   private String mTitle;
// 
//   public Task(String id, String title, String description) {
//     mId = id;
//     mTitle = title;
//     mDescription = description;
//   }
// 
//   protected Task(String id, String title, String description, boolean completed) {
//     mId = id;
//     mTitle = title;
//     mDescription = description;
//     mCompleted = completed;
//   }
// 
//   public Task(String title, String description) {
//     this(UUID.randomUUID().toString(), title, description);
//   }
// 
//   @Override
//   public int hashCode() {
//     return Objects.hashCode(mId, mTitle, mDescription, mCompleted);
//   }
// 
//   public void active() {
//     mCompleted = false;
//   }
// 
//   public void complete() {
//     mCompleted = true;
//   }
// 
//   public String getDescription() {
//     return mDescription;
//   }
// 
//   public void setDescription(String description) {
//     mDescription = description;
//   }
// 
//   public String getId() {
//     return mId;
//   }
// 
//   public String getTitle() {
//     return mTitle;
//   }
// 
//   public void setTitle(String title) {
//     mTitle = title;
//   }
// 
//   public boolean isActive() {
//     return !isCompleted();
//   }
// 
//   public boolean isCompleted() {
//     return mCompleted;
//   }
// 
//   public void setCompleted(boolean completed) {
//     mCompleted = completed;
//   }
// }
// 
// Path: sample/src/main/java/me/henrytao/mvvmlifecycledemo/di/Injector.java
// public class Injector {
// 
//   public static AppComponent component;
// 
//   public static AppComponent initialize(Application application) {
//     component = AppBuilder.build(application);
//     return component;
//   }
// }
// 
// Path: sample/src/main/java/me/henrytao/mvvmlifecycledemo/ui/base/Constants.java
// public class Constants {
// 
//   public interface Animation {
// 
//     int LONG = 600;
//     int MEDIUM = 400;
//     int SHORT = 200;
//   }
// 
//   public interface Extra {
// 
//     String ID = "ID";
//   }
// 
//   public interface Key {
// 
//     String ID = "ID";
//     String INDEX = "INDEX";
//   }
// }
// 
// Path: sample/src/test/java/me/henrytao/mvvmlifecycledemo/util/BaseTest.java
// public class BaseTest {
// 
//   @Before
//   public void initialize() {
//     MockitoAnnotations.initMocks(this);
//     Transformer.overrideComputationScheduler(Schedulers.immediate());
//     Transformer.overrideIoScheduler(Schedulers.immediate());
//     Transformer.overrideMainThreadScheduler(Schedulers.immediate());
//     Transformer.overrideNewThreadScheduler(Schedulers.immediate());
//   }
// 
//   @After
//   public void release() {
//     Transformer.resetComputationScheduler();
//     Transformer.resetIoScheduler();
//     Transformer.resetMainThreadScheduler();
//     Transformer.resetNewThreadScheduler();
//   }
// }


import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import org.junit.Test;
import org.mockito.Mockito;
import java.util.List;
import me.henrytao.mvvmlifecycle.event.Event1;
import me.henrytao.mvvmlifecycledemo.data.model.Task;
import me.henrytao.mvvmlifecycledemo.di.Injector;
import me.henrytao.mvvmlifecycledemo.ui.base.Constants;
import me.henrytao.mvvmlifecycledemo.util.BaseTest;
import rx.Observable;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyBoolean;
/*
 * Copyright 2016 "Henry Tao <hi@henrytao.me>"
 *
 * 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 me.henrytao.mvvmlifecycledemo.ui.tasks;





/**
 * Created by henrytao on 4/23/16.
 */
public class TasksViewModelTest extends BaseTest {

  TasksViewModel mTasksViewModel;

  @Override
  public void initialize() {
    super.initialize();
// Path: mvvm-life-cycle/src/main/java/me/henrytao/mvvmlifecycle/event/Event1.java
// public class Event1<T> implements Event {
// 
//   private static final int LENGTH = 1;
// 
//   private final Listener<T> mListener;
// 
//   public Event1(Listener<T> listener) {
//     mListener = listener;
//   }
// 
//   @SuppressWarnings("unchecked")
//   @Override
//   public void call(Object o) {
//     if (mListener != null && o instanceof Object[]) {
//       Object[] objects = (Object[]) o;
//       if (objects.length == LENGTH) {
//         mListener.onEventTrigger((T) objects[0]);
//         return;
//       }
//       throw new InvalidParams(String.format(Locale.US, "Required %d. Found %d", LENGTH, objects.length));
//     }
//   }
// 
//   public interface Listener<T> {
// 
//     void onEventTrigger(T data);
//   }
// }
// 
// Path: sample/src/main/java/me/henrytao/mvvmlifecycledemo/data/model/Task.java
// public class Task {
// 
//   private boolean mCompleted;
// 
//   private String mDescription;
// 
//   private String mId;
// 
//   private String mTitle;
// 
//   public Task(String id, String title, String description) {
//     mId = id;
//     mTitle = title;
//     mDescription = description;
//   }
// 
//   protected Task(String id, String title, String description, boolean completed) {
//     mId = id;
//     mTitle = title;
//     mDescription = description;
//     mCompleted = completed;
//   }
// 
//   public Task(String title, String description) {
//     this(UUID.randomUUID().toString(), title, description);
//   }
// 
//   @Override
//   public int hashCode() {
//     return Objects.hashCode(mId, mTitle, mDescription, mCompleted);
//   }
// 
//   public void active() {
//     mCompleted = false;
//   }
// 
//   public void complete() {
//     mCompleted = true;
//   }
// 
//   public String getDescription() {
//     return mDescription;
//   }
// 
//   public void setDescription(String description) {
//     mDescription = description;
//   }
// 
//   public String getId() {
//     return mId;
//   }
// 
//   public String getTitle() {
//     return mTitle;
//   }
// 
//   public void setTitle(String title) {
//     mTitle = title;
//   }
// 
//   public boolean isActive() {
//     return !isCompleted();
//   }
// 
//   public boolean isCompleted() {
//     return mCompleted;
//   }
// 
//   public void setCompleted(boolean completed) {
//     mCompleted = completed;
//   }
// }
// 
// Path: sample/src/main/java/me/henrytao/mvvmlifecycledemo/di/Injector.java
// public class Injector {
// 
//   public static AppComponent component;
// 
//   public static AppComponent initialize(Application application) {
//     component = AppBuilder.build(application);
//     return component;
//   }
// }
// 
// Path: sample/src/main/java/me/henrytao/mvvmlifecycledemo/ui/base/Constants.java
// public class Constants {
// 
//   public interface Animation {
// 
//     int LONG = 600;
//     int MEDIUM = 400;
//     int SHORT = 200;
//   }
// 
//   public interface Extra {
// 
//     String ID = "ID";
//   }
// 
//   public interface Key {
// 
//     String ID = "ID";
//     String INDEX = "INDEX";
//   }
// }
// 
// Path: sample/src/test/java/me/henrytao/mvvmlifecycledemo/util/BaseTest.java
// public class BaseTest {
// 
//   @Before
//   public void initialize() {
//     MockitoAnnotations.initMocks(this);
//     Transformer.overrideComputationScheduler(Schedulers.immediate());
//     Transformer.overrideIoScheduler(Schedulers.immediate());
//     Transformer.overrideMainThreadScheduler(Schedulers.immediate());
//     Transformer.overrideNewThreadScheduler(Schedulers.immediate());
//   }
// 
//   @After
//   public void release() {
//     Transformer.resetComputationScheduler();
//     Transformer.resetIoScheduler();
//     Transformer.resetMainThreadScheduler();
//     Transformer.resetNewThreadScheduler();
//   }
// }


// Path: sample/src/test/java/me/henrytao/mvvmlifecycledemo/ui/tasks/TasksViewModelTest.java
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import org.junit.Test;
import org.mockito.Mockito;
import java.util.List;
import me.henrytao.mvvmlifecycle.event.Event1;
import me.henrytao.mvvmlifecycledemo.data.model.Task;
import me.henrytao.mvvmlifecycledemo.di.Injector;
import me.henrytao.mvvmlifecycledemo.ui.base.Constants;
import me.henrytao.mvvmlifecycledemo.util.BaseTest;
import rx.Observable;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyBoolean;

/*
 * Copyright 2016 "Henry Tao <hi@henrytao.me>"
 *
 * 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 me.henrytao.mvvmlifecycledemo.ui.tasks;





/**
 * Created by henrytao on 4/23/16.
 */
public class TasksViewModelTest extends BaseTest {

  TasksViewModel mTasksViewModel;

  @Override
  public void initialize() {
    super.initialize();
    Injector.initialize(null);