You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
throwexception!=null?exception():newInvalidDateTimeException(parameterName,message??$"The specified date time \"{dateTime:O}\" must be of kind {DateTimeKind.Unspecified}, but actually is {dateTime.Kind}.");
.And.Message.Should().Contain($"{nameof(invalidDateTime)} must use kind \"{DateTimeKind.Unspecified}\", but it actually uses \"{invalidDateTime.Kind}\" and is \"{invalidDateTime:O}\".");
/// Ensures that the specified <paramref name="parameter"/> uses <see cref="DateTimeKind.Unspecified"/>, or otherwise throws an <see cref="InvalidDateTimeException"/>.
82
+
/// </summary>
83
+
/// <param name="parameter">The date time to be checked.</param>
84
+
/// <param name="parameterName">The name of the parameter (optional).</param>
85
+
/// <param name="message">The message that will be passed to the <see cref="InvalidDateTimeException"/> (optional).</param>
86
+
/// <exception cref="InvalidDateTimeException">Thrown when <paramref name="parameter"/> does not use <see cref="DateTimeKind.Unspecified"/>.</exception>
/// Ensures that the specified <paramref name="parameter"/> uses <see cref="DateTimeKind.Unspecified"/>, or otherwise throws your custom exception.
99
+
/// </summary>
100
+
/// <param name="parameter">The date time to be checked.</param>
101
+
/// <param name="exceptionFactory">The delegate that creates your custom exception. <paramref name="parameter"/> is passed to this delegate.</param>
102
+
/// <exception cref="Exception">Your custom exception thrown when <paramref name="parameter"/> does not use <see cref="DateTimeKind.Unspecified"/>.</exception>
thrownewInvalidDateTimeException(parameterName,message??$"{parameterName??"The date time"} must use kind \"{DateTimeKind.Local}\", but it actually uses \"{parameter.Kind}\" and is \"{parameter:O}\".");
365
365
366
+
/// <summary>
367
+
/// Throws the default <see cref="InvalidDateTimeException" /> indicating that a date time is not using <see cref="DateTimeKind.Unspecified" />, using the optional parameter name and message.
thrownewInvalidDateTimeException(parameterName,message??$"{parameterName??"The date time"} must use kind \"{DateTimeKind.Unspecified}\", but it actually uses \"{parameter.Kind}\" and is \"{parameter:O}\".");
372
+
366
373
/// <summary>
367
374
/// Throws the exception that is returned by <paramref name="exceptionFactory" />.
0 commit comments