Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Add basic implementation of ShadowProcess #861
ShadowProcess can be used when mocking android.os.Process.myPid().
I found a identical class from the android git repository.
'android.os.Process.myPid()' will return 0.
Sometimes it's enough. But it limits testability sometimes.
For examples, when I write the following method
I tested it as following
With ShadowProcess, it is possible to set pid to non-zero value. It can produce more test conditions.