This week I started to learn unit testing. I have setup my project succesfully, and now I'm writing my first tests. I have 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 currentt 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?.
samedi 3 janvier 2015
Robolectric: How to fake the return value of system classes?
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire