@Before
 public void setUp() throws Exception {
   rnrFormRepository =
       RoboGuice.getInjector(RuntimeEnvironment.application).getInstance(RnrFormRepository.class);
   signatureRepository =
       RoboGuice.getInjector(RuntimeEnvironment.application)
           .getInstance(RnrFormSignatureRepository.class);
 }
  @Before
  public void setUp() throws LMISException, ParseException {
    itemView =
        LayoutInflater.from(RuntimeEnvironment.application)
            .inflate(R.layout.item_stock_movement, null, false);
    mockedListener = mock(StockMovementAdapter.MovementChangedListener.class);
    viewHolder = new StockMovementViewHolder(itemView, mockedListener);

    viewModel =
        new StockMovementViewModelBuilder()
            .withMovementDate("2015-11-11")
            .withDocumentNo("12345")
            .withNegativeAdjustment(null)
            .withPositiveAdjustment(null)
            .withIssued("30")
            .withReceived(null)
            .withStockExistence("70")
            .withIsDraft(false)
            .withMovementReason(
                new MovementReasonManager.MovementReason(
                    MovementReasonManager.MovementType.ISSUE, "ISSUE_1", "issue description"))
            .build();

    StockRepository stockRepository =
        RoboGuice.getInjector(RuntimeEnvironment.application).getInstance(StockRepository.class);

    stockCard = StockCardBuilder.saveStockCardWithOneMovement(stockRepository);
  }
Пример #3
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   final RoboInjector injector = RoboGuice.getInjector(getActivity());
   eventManager = injector.getInstance(EventManager.class);
   injector.injectMembersWithoutViews(this);
   super.onCreate(savedInstanceState);
   eventManager.fire(new OnCreateEvent(savedInstanceState));
 }
 public CourseDiscussionResponsesAdapter(
     @NonNull Context context,
     @NonNull Listener listener,
     @NonNull DiscussionThread discussionThread) {
   this.context = context;
   this.discussionThread = discussionThread;
   this.listener = listener;
   RoboGuice.getInjector(context).injectMembers(this);
 }
 public DiscussionCommentsAdapter(
     @NonNull Context context,
     @NonNull Listener listener,
     @NonNull DiscussionThread thread,
     @NonNull DiscussionComment response) {
   this.context = context;
   this.listener = listener;
   this.thread = thread;
   this.response = response;
   RoboGuice.getInjector(context).injectMembers(this);
 }
 public static void setUp(Object testObject, TestGuiceModule module, Module productionModule) {
   Module roboGuiceModule = RoboGuice.newDefaultRoboModule(Robolectric.application);
   Module testModule =
       productionModule != null
           ? Modules.override(roboGuiceModule, productionModule, new RobolectricModule())
               .with(module)
           : Modules.override(roboGuiceModule, new RobolectricModule()).with(module);
   RoboGuice.setBaseApplicationInjector(
       Robolectric.application, RoboGuice.DEFAULT_STAGE, testModule);
   RoboInjector injector = RoboGuice.getInjector(Robolectric.application);
   injector.injectMembers(testObject);
 }
    @Override
    public void prepareTest(Object test) {
      MySampleApplication application = (MySampleApplication) Robolectric.application;

      RoboGuice.setBaseApplicationInjector(
          application,
          RoboGuice.DEFAULT_STAGE,
          RoboGuice.newDefaultRoboModule(application),
          new TestApplicationModule());

      RoboGuice.getInjector(application).injectMembers(test);
      MockitoAnnotations.initMocks(test);
    }
Пример #8
0
  @Before
  public void setUp() {

    RoboGuice.setBaseApplicationInjector(
        Robolectric.application,
        RoboGuice.DEFAULT_STAGE,
        Modules.override(RoboGuice.newDefaultRoboModule(Robolectric.application)).with(testModule));

    quizzActivity = new QuizzActivity();

    RoboInjector injector = RoboGuice.getInjector(quizzActivity);
    injector.injectMembers(this);
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);

    // Perform dependency injection
    final RoboInjector injector = RoboGuice.getInjector(this.getApplicationContext());
    injector.injectMembersWithoutViews(this);

    // Get account and token type from intent
    accountType = getIntent().getStringExtra(AccountManager.KEY_ACCOUNT_TYPE);
    authTokenType = getIntent().getStringExtra(AccountManager.KEY_AUTHENTICATOR_TYPES);
    if (authTokenType == null) {
      authTokenType = AccountConstants.AUTHTOKEN_TYPE_FULL_ACCESS;
    }
    initViews();
    initListeners();
  }
Пример #10
0
 @Override
 public void onContentChanged() {
   super.onContentChanged();
   RoboGuice.getInjector(this).injectViewMembers(this);
   eventManager.fire(new OnContentChangedEvent());
 }
Пример #11
0
 @Override
 public void onViewCreated(View view, Bundle savedInstanceState) {
   super.onViewCreated(view, savedInstanceState);
   RoboGuice.getInjector(getActivity()).injectViewMembers(this);
 }
Пример #12
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   RoboGuice.getInjector(getActivity()).injectMembersWithoutViews(this);
 }
 @Inject
 public ScheduledTaskRepaint(Context context) {
   // Log.d("DI", "ScheduledTaskRepaint creation started...");
   RoboGuice.getInjector(context).injectMembers(this);
   // Log.d("DI", "ScheduledTaskRepaint created!");
 }
 @Override
 protected RnrFormRepository initRnrFormRepository() {
   mmiaRepository = RoboGuice.getInjector(LMISApp.getContext()).getInstance(MMIARepository.class);
   return mmiaRepository;
 }
 @Before
 public void setUp() throws Exception {
   syncErrorsRepository =
       RoboGuice.getInjector(RuntimeEnvironment.application)
           .getInstance(SyncErrorsRepository.class);
 }