Java Code Examples for android.test.MoreAsserts#assertEquals()
The following examples show how to use
android.test.MoreAsserts#assertEquals() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FakeTrackOutput.java From ExoPlayer-Offline with Apache License 2.0 | 6 votes |
public void assertEquals(FakeTrackOutput expected) { Assert.assertEquals(expected.format, format); Assert.assertEquals(expected.sampleTimesUs.size(), sampleTimesUs.size()); MoreAsserts.assertEquals(expected.sampleData, sampleData); for (int i = 0; i < sampleTimesUs.size(); i++) { Assert.assertEquals(expected.sampleTimesUs.get(i), sampleTimesUs.get(i)); Assert.assertEquals(expected.sampleFlags.get(i), sampleFlags.get(i)); Assert.assertEquals(expected.sampleStartOffsets.get(i), sampleStartOffsets.get(i)); Assert.assertEquals(expected.sampleEndOffsets.get(i), sampleEndOffsets.get(i)); if (expected.sampleEncryptionKeys.get(i) == null) { Assert.assertNull(sampleEncryptionKeys.get(i)); } else { MoreAsserts.assertEquals(expected.sampleEncryptionKeys.get(i), sampleEncryptionKeys.get(i)); } } }
Example 2
Source File: SpannableTest.java From j2objc with Apache License 2.0 | 6 votes |
@MediumTest public void testGetSpans() { Spannable spannable = newSpannableWithText("abcdef"); Object emptySpan = new Object(); spannable.setSpan(emptySpan, 1, 1, 0); Object unemptySpan = new Object(); spannable.setSpan(unemptySpan, 1, 2, 0); Object[] spans; // Empty spans are included when they merely abut the query region // but other spans are not, unless the query region is empty, in // in which case any abutting spans are returned. spans = spannable.getSpans(0, 1, Object.class); MoreAsserts.assertEquals(new Object[]{emptySpan}, spans); spans = spannable.getSpans(0, 2, Object.class); MoreAsserts.assertEquals(new Object[]{emptySpan, unemptySpan}, spans); spans = spannable.getSpans(1, 2, Object.class); MoreAsserts.assertEquals(new Object[]{emptySpan, unemptySpan}, spans); spans = spannable.getSpans(2, 2, Object.class); MoreAsserts.assertEquals(new Object[]{unemptySpan}, spans); }
Example 3
Source File: FakeTrackOutput.java From ExoPlayer-Offline with Apache License 2.0 | 5 votes |
public void assertSample(int index, byte[] data, long timeUs, int flags, byte[] encryptionKey) { byte[] actualData = getSampleData(index); MoreAsserts.assertEquals(data, actualData); Assert.assertEquals(timeUs, (long) sampleTimesUs.get(index)); Assert.assertEquals(flags, (int) sampleFlags.get(index)); byte[] sampleEncryptionKey = sampleEncryptionKeys.get(index); if (encryptionKey == null) { Assert.assertEquals(null, sampleEncryptionKey); } else { MoreAsserts.assertEquals(encryptionKey, sampleEncryptionKey); } }
Example 4
Source File: TextUtilsTest.java From j2objc with Apache License 2.0 | 5 votes |
private void stringSplitterTestHelper(String string, String[] expectedStrings) { TextUtils.StringSplitter splitter = new TextUtils.SimpleStringSplitter(','); splitter.setString(string); List<String> strings = Lists.newArrayList(); for (String s : splitter) { strings.add(s); } MoreAsserts.assertEquals(expectedStrings, strings.toArray(new String[]{})); }