@@ -0,0 +1,2120 @@
+/*%0A * Copyright 2016 Martin Kamp Jensen%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.github.mkjensen.dml.ondemand;%0A%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.powermock.api.mockito.PowerMockito.mock;%0Aimport static org.powermock.api.mockito.PowerMockito.when;%0A%0Aimport android.support.v17.leanback.widget.AbstractDetailsDescriptionPresenter.ViewHolder;%0Aimport android.widget.TextView;%0A%0Aimport com.github.mkjensen.dml.PowerMockTest;%0A%0Aimport org.junit.Test;%0Aimport org.powermock.core.classloader.annotations.PrepareForTest;%0A%0A/**%0A * Unit tests for %7B@link VideoDetailsPresenter%7D.%0A */%0A@PrepareForTest(Video.class)%0Apublic class VideoDetailsPresenterTest extends PowerMockTest %7B%0A%0A  @Test%0A  public void onBindDescription_shouldSetBodyAndTitleOfViewHolder() %7B%0A%0A    // Given%0A    ViewHolder viewHolderMock = createViewHolderMock();%0A    Video videoMock = mock(Video.class);%0A    String description = %22description%22;%0A    when(videoMock.getDescription()).thenReturn(description);%0A    String title = %22title%22;%0A    when(videoMock.getTitle()).thenReturn(title);%0A%0A    // When%0A    new VideoDetailsPresenter().onBindDescription(viewHolderMock, videoMock);%0A%0A    // Then%0A    verify(viewHolderMock.getBody()).setText(description);%0A    verify(viewHolderMock.getTitle()).setText(title);%0A  %7D%0A%0A  private static ViewHolder createViewHolderMock() %7B%0A    ViewHolder mock = mock(ViewHolder.class);%0A    TextView bodyMock = mock(TextView.class);%0A    TextView titleMock = mock(TextView.class);%0A    when(mock.getBody()).thenReturn(bodyMock);%0A    when(mock.getTitle()).thenReturn(titleMock);%0A    return mock;%0A  %7D%0A%7D%0A

Add unit tests for VideoDetailsPresenter