Testing dates

I am trying to test my app. The app compares dates with today. I want to see if the result is as expected in past and future dates. How can I test or simulate that today is a from me specified date and time?

This would be a great scenario for unit testing.

You can take a look here at the documentation on unit testing.

I can’t link specific websites where you can also learn tons about unit testing and how it can benefit you, especially in the situation like above.

Your unit tests would be pretty simple once you understand how to write them. You simply want to get today’s date Date() and compare it to another date variable you have set yourself.

Testing dates
 
 
Q