I've noticed a bug in NodaTime 2.0 LocalDate constructor - parameter validation doesn't seem to be working. It was working as expected in version 1.3.
Example:
var date = new LocalDate(2001, 1, -1);
Expected result:
An ArgumentOutOfRangeException should be thrown as described in documentation:
<exception cref="ArgumentOutOfRangeException">The parameters do not form a valid date.</exception>
Actual result:
A LocalDate instance is created and can be used:
var date = new LocalDate(2001, 1, -1);
var year = date.Year; // value: 0
var month = date.Month; // value: 32
var day = date.Day; // value: 63
An ArgumentOutOfRangeException is thrown from ToString() method.
I've noticed a bug in NodaTime 2.0
LocalDateconstructor - parameter validation doesn't seem to be working. It was working as expected in version 1.3.Example:
var date = new LocalDate(2001, 1, -1);Expected result:
An
ArgumentOutOfRangeExceptionshould be thrown as described in documentation:Actual result:
A
LocalDateinstance is created and can be used:An
ArgumentOutOfRangeExceptionis thrown fromToString()method.