SPRNET-989 - Avoid throwing exception in Spring's custom timespan converter when delegating to default .NET BCL implementation.
Thanks Roberto Paterlini!
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
#region Imports
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
#endregion
|
||||
@@ -113,10 +113,16 @@ namespace Spring.Core.TypeConversion
|
||||
public void ConvertFromStringWithHourSpecifier()
|
||||
{
|
||||
TimeSpanConverter tsc = new TimeSpanConverter();
|
||||
|
||||
object timeSpan = tsc.ConvertFrom("1H");
|
||||
Assert.IsNotNull(timeSpan);
|
||||
Assert.IsTrue(timeSpan is TimeSpan);
|
||||
Assert.AreEqual(TimeSpan.FromHours(1), (TimeSpan)timeSpan);
|
||||
|
||||
tsc.ConvertFrom("1h");
|
||||
Assert.IsNotNull(timeSpan);
|
||||
Assert.IsTrue(timeSpan is TimeSpan);
|
||||
Assert.AreEqual(TimeSpan.FromHours(1), (TimeSpan)timeSpan);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
Reference in New Issue
Block a user