// Path: app/src/debug/java/com/newegg/tr/dagger2prac/view/component/SettingComponent.java
// @Singleton
// @Component(
//         modules = TestSettingModule.class
// )
// public interface SettingComponent {
// 
//     void inject(SettingActivity activity);
// 
//     void inject(SettingTestCase testSetting);
// 
//     Config getConfig();
// 
//     public class Initializer {
//         public static SettingComponent mInstance;
// 
//         public static SettingComponent init(Application app, SettingView view) {
// 
//             SettingComponent component = Dagger_SettingComponent.builder()
//                     .testSettingModule(new TestSettingModule(view, ((Dagger2pracApp) app).MOCK_MODE)).build();
// 
//             mInstance = component;
//             return component;
//         }
// 
//     }
// 
// }
// 
// Path: app/src/debug/java/com/newegg/tr/dagger2prac/view/SettingTestCase.java
// public class SettingTestCase extends ActivityInstrumentationTestCase2<SettingActivity> {
// 
//     @Inject
//     protected Config mMockConfig;
// 
//     public SettingTestCase() {
//         super(SettingActivity.class);
//     }
// }
// 
// Path: app/src/debug/java/com/newegg/tr/dagger2prac/view/module/TestSettingModule.java
// @Module
// public class TestSettingModule {
// 
// 
//     public final static String INIT_NAME = "大中天";
//     SettingView mView;
//     @Mock
//     Config mMockConfig;
//     private boolean mIsMock;
// 
//     public TestSettingModule(SettingView view, boolean isMock) {
//         mView = view;
//         mIsMock = isMock;
//         MockitoAnnotations.initMocks(this);
//         when(mMockConfig.getUserName()).thenReturn(INIT_NAME);
//     }
// 
//     @Singleton
//     @Provides
//     public SettingPresenter provideSettingPresenter(Config config) {
//         return new SettingPresenterImpl(mView, config);
//     }
// 
//     @Singleton
//     @Provides
//     public Config provideConfig() {
//         return (mIsMock) ? mMockConfig : new ConfigManager();
//     }
// 
// }


import com.newegg.tr.dagger2prac.R;
import com.newegg.tr.dagger2prac.view.component.SettingComponent;
import com.newegg.tr.dagger2prac.view.SettingTestCase;
import com.newegg.tr.dagger2prac.view.module.TestSettingModule;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.clearText;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.action.ViewActions.typeText;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static org.mockito.Mockito.when;
package com.newegg.tr.dagger2prac.ui;



/**
 * Created by william on 15/2/13.
 */
public class SettingActivityTest extends SettingTestCase {


    String changedName = "William";

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        getActivity();
// Path: app/src/debug/java/com/newegg/tr/dagger2prac/view/component/SettingComponent.java
// @Singleton
// @Component(
//         modules = TestSettingModule.class
// )
// public interface SettingComponent {
// 
//     void inject(SettingActivity activity);
// 
//     void inject(SettingTestCase testSetting);
// 
//     Config getConfig();
// 
//     public class Initializer {
//         public static SettingComponent mInstance;
// 
//         public static SettingComponent init(Application app, SettingView view) {
// 
//             SettingComponent component = Dagger_SettingComponent.builder()
//                     .testSettingModule(new TestSettingModule(view, ((Dagger2pracApp) app).MOCK_MODE)).build();
// 
//             mInstance = component;
//             return component;
//         }
// 
//     }
// 
// }
// 
// Path: app/src/debug/java/com/newegg/tr/dagger2prac/view/SettingTestCase.java
// public class SettingTestCase extends ActivityInstrumentationTestCase2<SettingActivity> {
// 
//     @Inject
//     protected Config mMockConfig;
// 
//     public SettingTestCase() {
//         super(SettingActivity.class);
//     }
// }
// 
// Path: app/src/debug/java/com/newegg/tr/dagger2prac/view/module/TestSettingModule.java
// @Module
// public class TestSettingModule {
// 
// 
//     public final static String INIT_NAME = "大中天";
//     SettingView mView;
//     @Mock
//     Config mMockConfig;
//     private boolean mIsMock;
// 
//     public TestSettingModule(SettingView view, boolean isMock) {
//         mView = view;
//         mIsMock = isMock;
//         MockitoAnnotations.initMocks(this);
//         when(mMockConfig.getUserName()).thenReturn(INIT_NAME);
//     }
// 
//     @Singleton
//     @Provides
//     public SettingPresenter provideSettingPresenter(Config config) {
//         return new SettingPresenterImpl(mView, config);
//     }
// 
//     @Singleton
//     @Provides
//     public Config provideConfig() {
//         return (mIsMock) ? mMockConfig : new ConfigManager();
//     }
// 
// }


// Path: app/src/androidTest/java/com/newegg/tr/dagger2prac/ui/SettingActivityTest.java
import com.newegg.tr.dagger2prac.R;
import com.newegg.tr.dagger2prac.view.component.SettingComponent;
import com.newegg.tr.dagger2prac.view.SettingTestCase;
import com.newegg.tr.dagger2prac.view.module.TestSettingModule;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.clearText;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.action.ViewActions.typeText;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static org.mockito.Mockito.when;

package com.newegg.tr.dagger2prac.ui;



/**
 * Created by william on 15/2/13.
 */
public class SettingActivityTest extends SettingTestCase {


    String changedName = "William";

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        getActivity();
        SettingComponent.Initializer.mInstance.inject(this);