I have setup my project with Robolectric succesfully and now I'm writing my first tests. I wrote a method that receives 2 params, the opening and the closing time of a venue and returns true if the venue is open at the current time or false otherwise. Internally that method uses Calendar c = Calendar.getInstance(); to get the current time. How can a set time that I want the Calendar class returns? I know that in Microsoft Fakes framework there is something called shims that fakes the return values of system classes. Do you know any similar technology in Robolectric framework?.
lundi 5 janvier 2015
Robolectric: How to fake Calendar class
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire