Java 类org.robolectric.shadows.ShadowRelativeLayout 实例源码

项目:Fabric-Example-App-Android    文件:VastVideoViewControllerTest.java   
@Test
public void constructor_shouldAddCloseButtonWidgetToLayoutAndSetToGoneWithOnTouchListeners() throws Exception {
    initializeSubject();

    VastVideoCloseButtonWidget closeButtonWidget = subject.getCloseButtonWidget();
    assertThat(closeButtonWidget.getParent()).isEqualTo(subject.getLayout());
    assertThat(closeButtonWidget.getVisibility()).isEqualTo(View.GONE);

    ShadowRelativeLayout closeButtonWidgetShadow = (ShadowRelativeLayout) shadowOf(closeButtonWidget);
    assertThat(closeButtonWidgetShadow.getOnTouchListener()).isNull();

    ShadowImageView closeButtonImageViewShadow = shadowOf(closeButtonWidget.getImageView());
    assertThat(closeButtonImageViewShadow.getOnTouchListener()).isNotNull();

    ShadowTextView closeButtonTextViewShadow = shadowOf(closeButtonWidget.getTextView());
    assertThat(closeButtonTextViewShadow.getOnTouchListener()).isNotNull();
}