Example usage for android.app DialogFragment getArguments

List of usage examples for android.app DialogFragment getArguments

Introduction

In this page you can find the example usage for android.app DialogFragment getArguments.

Prototype

final public Bundle getArguments() 

Source Link

Document

Return the arguments supplied to #setArguments , if any.

Usage

From source file:org.openlmis.core.view.fragment.VIARequisitionFragmentTest.java

@Test
public void shouldShowSubmitSignatureDialog() {
    VIARequisitionFragment.showSignDialog(true);

    DialogFragment fragment = (DialogFragment) (VIARequisitionFragment.getActivity().getFragmentManager()
            .findFragmentByTag("signature_dialog"));

    assertThat(fragment).isNotNull();/*from  w w w  .  j  av a2s . c  om*/

    Dialog dialog = fragment.getDialog();

    assertThat(dialog).isNotNull();

    String alertMessage = VIARequisitionFragment.getString(R.string.msg_via_submit_signature);
    assertThat(fragment.getArguments().getString("title")).isEqualTo(alertMessage);
}

From source file:org.openlmis.core.view.fragment.VIARequisitionFragmentTest.java

@Test
public void shouldShowApproveSignatureDialog() {
    VIARequisitionFragment.showSignDialog(false);

    DialogFragment fragment = (DialogFragment) (VIARequisitionFragment.getActivity().getFragmentManager()
            .findFragmentByTag("signature_dialog"));

    assertThat(fragment).isNotNull();//from  w ww .  j  a v  a 2s. co  m

    Dialog dialog = fragment.getDialog();

    assertThat(dialog).isNotNull();

    String alertMessage = VIARequisitionFragment.getString(R.string.msg_approve_signature_via);
    assertThat(fragment.getArguments().getString("title")).isEqualTo(alertMessage);
}