### Question:
IllustrationVideoView extends TextureView implements Animatable,
        SurfaceTextureListener,
        OnPreparedListener,
        OnSeekCompleteListener,
        OnInfoListener,
        OnErrorListener { public void setVideoResource(@RawRes int videoResId, String videoResPackageName) { if (videoResId != this.videoResId || (videoResPackageName != null && !videoResPackageName.equals(this.videoResPackageName))) { this.videoResId = videoResId; this.videoResPackageName = videoResPackageName; createMediaPlayer(); } } IllustrationVideoView(Context context, AttributeSet attrs); void setVideoResource(@RawRes int videoResId, String videoResPackageName); void setVideoResource(@RawRes int resId); @Override void onWindowFocusChanged(boolean hasWindowFocus); void release(); @Override void onSurfaceTextureAvailable(SurfaceTexture surfaceTexture, int width, int height); @Override void onSurfaceTextureSizeChanged(SurfaceTexture surfaceTexture, int width, int height); @Override boolean onSurfaceTextureDestroyed(SurfaceTexture surfaceTexture); @Override void onSurfaceTextureUpdated(SurfaceTexture surfaceTexture); @Override void start(); @Override void stop(); @Override boolean isRunning(); @Override boolean onInfo(MediaPlayer mp, int what, int extra); @Override void onPrepared(MediaPlayer mp); @Override void onSeekComplete(MediaPlayer mp); int getCurrentPosition(); @Override boolean onError(MediaPlayer mediaPlayer, int what, int extra);  }### Answer:
@Test public void testSetVideoResId() { createDefaultView(); @RawRes int black = android.R.color.black; view.setVideoResource(black); assertThat(getShadowMediaPlayer().getSourceUri().toString()) .isEqualTo("android.resource: }
@Test public void setVideoResId_resetDiffVideoResFromDiffPackage_videoResShouldBeSet() { createDefaultView(); String newPackageName = "com.android.fakepackage"; @RawRes int black = android.R.color.black; addMediaInfo(black, newPackageName); view.setVideoResource(black, newPackageName); assertThat(getShadowMediaPlayer().getSourceUri().toString()) .isEqualTo("android.resource: }
@Test public void setVideoResId_resetDiffVideoResFromSamePackage_videoResShouldBeSet() { createDefaultView(); String defaultPackageName = "com.android.setupwizardlib"; @RawRes int black = android.R.color.black; addMediaInfo(black, defaultPackageName); view.setVideoResource(black, defaultPackageName); assertThat(getShadowMediaPlayer().getSourceUri().toString()) .isEqualTo("android.resource: }
@Test public void setVideoResId_resetSameVideoResFromDifferentPackage_videoResShouldBeSet() { createDefaultView(); @RawRes int white = android.R.color.white; String newPackageName = "com.android.fakepackage"; addMediaInfo(white, newPackageName); view.setVideoResource(white, newPackageName); assertThat(getShadowMediaPlayer().getSourceUri().toString()) .isEqualTo("android.resource: }