Ok, the ruby lovers will laugh, the ruby haters will, well, hate.
public static TimeSpan Minutes (this int minutes) {
return new TimeSpan(0, minutes, 0);
}
public static TimeSpan Hours (this int hours) {
return new TimeSpan(hours, 0, 0);
}
public static TimeSpan Seconds (this int seconds) {
return new TimeSpan(0,0, seconds);
}
So that now I can write readable code like this:
var fiver = 5.Seconds();
var fivertoo = 5.Hours();
Assert.That( fiver.IsLessThan(fivertoo) );