-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #551 from OpenSRP/images-and-text-label-view
Cleaned up recycler view bug in DynamicLabelAdapter
- Loading branch information
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...-json-form-wizard/src/test/java/com/vijay/jsonwizard/adapter/DynamicLabelAdapterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.vijay.jsonwizard.adapter; | ||
|
||
import android.support.v7.widget.RecyclerView; | ||
import android.widget.LinearLayout; | ||
|
||
import com.vijay.jsonwizard.BaseTest; | ||
import com.vijay.jsonwizard.model.DynamicLabelInfo; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.robolectric.RuntimeEnvironment; | ||
|
||
import java.util.ArrayList; | ||
|
||
import static org.junit.Assert.assertNotNull; | ||
import static org.junit.Assert.assertTrue; | ||
import static org.mockito.Mockito.spy; | ||
|
||
public class DynamicLabelAdapterTest extends BaseTest { | ||
|
||
private DynamicLabelAdapter multiSelectListAdapter; | ||
|
||
@Before | ||
public void setUp() { | ||
multiSelectListAdapter = spy(new DynamicLabelAdapter(RuntimeEnvironment.application, new ArrayList<DynamicLabelInfo>())); | ||
} | ||
|
||
@Test | ||
public void testOnCreateViewHolder() { | ||
LinearLayout linearLayout = new LinearLayout(RuntimeEnvironment.application); | ||
RecyclerView.ViewHolder itemView = multiSelectListAdapter.onCreateViewHolder(linearLayout, 0); | ||
assertNotNull(itemView); | ||
assertTrue(itemView instanceof DynamicLabelAdapter.RecyclerViewHolder); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters