AssertParcelable

Additional

Language
Java
Version
N/A
Created
Oct 30, 2015
Updated
Apr 3, 2017 (Retired)
Owner
Artem Zinnatullin :slowpoke: (artem-zinnatullin)
Contributor
Artem Zinnatullin :slowpoke: (artem-zinnatullin)
1
Activity
Badge
Generate
Download
Source code

Announcement

AssertParcelable

Checks that class properly implements android.os.Parcelable interface forcing Framework to serialize and deserialize it and then checks that deserialized object is equal to original one.

Works in both Instrumentation and Robolectric environments.

Download

com.artemzin.assert-parcelable:assert-parcelable:1.0.1

All versions on Maven Central.

Example of

build.gradle:// Add for unit tests (Robolectric, etc) testCompile 'com.artemzin.assert-parcelable:assert-parcelable:1.0.1'// Or/and add for instrumentation tests (emulator, device, etc) androidTestCompile 'com.artemzin.assert-parcelable:assert-parcelable:1.0.1'


Usage example:

import staticAssertParcelable.assertThatObjectParcelable;

@Testpublicvoid verifyThatMyClassIsParcelable() {
  // Class must properly implement equals()!MyParcelableClass object =newMyParcelableClass("someValue");
  assertThatObjectParcelable(object);
}