-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix rendering after deleting playlist items
Fixes #910
- Loading branch information
Showing
3 changed files
with
58 additions
and
7 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
app/src/androidTest/java/github/daneren2005/dsub/adapter/EntryGridAdapterTest.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,44 @@ | ||
package github.daneren2005.dsub.adapter; | ||
|
||
|
||
import android.content.Context; | ||
import android.test.AndroidTestCase; | ||
import android.test.mock.MockContext; | ||
import android.util.Log; | ||
import android.view.View; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import github.daneren2005.dsub.domain.MusicDirectory.Entry; | ||
|
||
|
||
public class EntryGridAdapterTest extends AndroidTestCase { | ||
private EntryGridAdapter mAdapter; | ||
|
||
|
||
public EntryGridAdapterTest() { | ||
super(); | ||
} | ||
|
||
protected void setUp() throws Exception { | ||
super.setUp(); | ||
} | ||
|
||
public void testRemoveAt() { | ||
Entry a = new Entry("a"); | ||
Entry c = new Entry("c"); | ||
|
||
List<Entry> section = new ArrayList<>(Arrays.asList( | ||
a, | ||
new Entry("b"), | ||
c, | ||
new Entry("d"), | ||
new Entry("e"))); | ||
mAdapter = new EntryGridAdapter(null, section, null, false); | ||
|
||
mAdapter.removeAt(Arrays.asList(1, 3, 4)); | ||
assertEquals(new ArrayList<>(Arrays.asList(a, c)), section); | ||
} | ||
} |
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
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