use of com.orhanobut.dialogplus.DialogPlusBuilder in project dialogplus by orhanobut.
the class DialogPlusBuilderTest method testInAnimation.
@Test
public void testInAnimation() {
DialogPlusBuilder builder = DialogPlus.newDialog(context);
assertThat(builder.getInAnimation()).isNotNull();
//TODO
}
use of com.orhanobut.dialogplus.DialogPlusBuilder in project dialogplus by orhanobut.
the class DialogPlusBuilderTest method testSetOnBackPressListener.
@Test
public void testSetOnBackPressListener() {
DialogPlusBuilder builder = DialogPlus.newDialog(context);
assertThat(builder.getOnBackPressListener()).isNull();
OnBackPressListener listener = new OnBackPressListener() {
@Override
public void onBackPressed(DialogPlus dialogPlus) {
}
};
builder.setOnBackPressListener(listener);
assertThat(builder.getOnBackPressListener()).isNotNull();
assertThat(builder.getOnBackPressListener()).isEqualTo(listener);
}
use of com.orhanobut.dialogplus.DialogPlusBuilder in project dialogplus by orhanobut.
the class DialogPlusBuilderTest method getContextShouldNotReturnNull.
@Test
public void getContextShouldNotReturnNull() {
DialogPlusBuilder builder = DialogPlus.newDialog(context);
assertThat(builder.getContext()).isNotNull();
}
use of com.orhanobut.dialogplus.DialogPlusBuilder in project dialogplus by orhanobut.
the class DialogPlusBuilderTest method getHolder_shouldBeListHolderAsDefault.
@Test
public void getHolder_shouldBeListHolderAsDefault() {
DialogPlusBuilder builder = DialogPlus.newDialog(context);
assertThat(builder.getHolder()).isNotNull();
assertThat(builder.getHolder()).isInstanceOf(ListHolder.class);
}
use of com.orhanobut.dialogplus.DialogPlusBuilder in project dialogplus by orhanobut.
the class DialogPlusBuilderTest method testDefaultContentMarginWhenGravityCenter.
@Test
public void testDefaultContentMarginWhenGravityCenter() {
DialogPlusBuilder builder = DialogPlus.newDialog(context);
builder.setGravity(Gravity.CENTER);
int minimumMargin = context.getResources().getDimensionPixelSize(R.dimen.dialogplus_default_center_margin);
int[] margin = builder.getContentMargin();
assertThat(margin[0]).isEqualTo(minimumMargin);
assertThat(margin[1]).isEqualTo(minimumMargin);
assertThat(margin[2]).isEqualTo(minimumMargin);
assertThat(margin[3]).isEqualTo(minimumMargin);
}
Aggregations