I was wondering how to properly test the functionality, which depends on changing the date or time from Android. Suppose I have events that need to be processed for the first time of each month, and the result of this processing depends on the current date / time. I miss the opportunity to fake a specific date / time in the Android testing platform. How should we check such things?
Of course, you can use an abstraction from real time, requesting the date / time not directly from the framework, but from an additional object. How could I set a fake date / time on this object from the test code. But is there really no support for such a common need built into the Android testing platform?
source share