Function Kata "Mail Followup"
Implement a function to translate mail followup email addresses into date and time information. See also the Architecture Kata of the same name.
The function to be implemented has the following signature:
DateTime FollowupZeitpunkt(DateTime now, string emailadresse);
Examples for the structure of email addresses:
- 7days@followup.cc
From now on in 7 days. - 12hours@followup.cc
From now on in 12 hours. - aug15-9am@followup.cc
Next August 15 at 9 a.m. - 1week3days5hours@followup.cc
From now on in one week, three days and five hours.
For example, if the function is called as follows
var t = FollowupTime(new DateTime(2013, 2, 4, 10, 30, 0), "2weeks1day1hour");
then has t the value DateTime(2013, 2, 19, 11, 30, 0).