Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/artem-zinnatullin/assertparcelable
Checks Parcelable implementation.
https://github.com/artem-zinnatullin/assertparcelable
Last synced: 23 days ago
JSON representation
Checks Parcelable implementation.
- Host: GitHub
- URL: https://github.com/artem-zinnatullin/assertparcelable
- Owner: artem-zinnatullin
- License: apache-2.0
- Created: 2015-10-30T01:48:33.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-03T15:52:38.000Z (over 7 years ago)
- Last Synced: 2023-07-27T13:34:31.895Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 63.5 KB
- Stars: 48
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### 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](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22assert-parcelable%22).
---------------
Example of `build.gradle`:
```groovy
// 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:
```java
import static AssertParcelable.assertThatObjectParcelable;@Test
public void verifyThatMyClassIsParcelable() {
// Class must properly implement equals()!
MyParcelableClass object = new MyParcelableClass("someValue");
assertThatObjectParcelable(object);
}
```