Skip to content

Proof of concept - override the DateTime object in order to run tests

Notifications You must be signed in to change notification settings

elmika/mock-now

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

POC: Manage time dependencies in objects

Sample object with methods depending on current time. We want to inject a clock in order to run unit tests consistently.

BookingObject::book BookingObject::confirmBooking

With the following rule: if more than 5 minutes have passed between book and confirmBooking, then confirmation should fail (new booking is required).

About

Proof of concept - override the DateTime object in order to run tests

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages