Skip to content

Commit 1a71772

Browse files
updated exception.
1 parent 9e82f24 commit 1a71772

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/Controls/src/Core/DateTimeTypeConverter.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public override object ConvertFrom(ITypeDescriptorContext? context, CultureInfo?
3737
}
3838
}
3939

40-
throw new NotSupportedException($"Cannot convert \"{value}\" into {typeof(DateTime)}");
40+
throw new NotImplementedException($"Cannot convert \"{value}\" into {typeof(DateTime)}");
4141
}
4242

4343
public override object ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type? destinationType)
@@ -62,7 +62,7 @@ public override object ConvertTo(ITypeDescriptorContext? context, CultureInfo? c
6262
}
6363
}
6464

65-
throw new NotSupportedException($"Cannot convert \"{value}\" into {destinationType}");
65+
throw new NotImplementedException($"Cannot convert \"{value}\" into {destinationType}");
6666
}
6767

6868
static object ConvertToDestinationType(DateOnly dateOnly, Type? destinationType, CultureInfo? culture)
@@ -80,7 +80,7 @@ static object ConvertToDestinationType(DateOnly dateOnly, Type? destinationType,
8080
return dateOnly;
8181
}
8282

83-
throw new NotSupportedException($"Cannot convert \"{dateOnly}\" into {destinationType}");
83+
throw new NotImplementedException($"Cannot convert \"{dateOnly}\" into {destinationType}");
8484
}
8585

8686
static object ConvertToDestinationType(DateTime dateTime, Type? destinationType, CultureInfo? culture)
@@ -98,7 +98,7 @@ static object ConvertToDestinationType(DateTime dateTime, Type? destinationType,
9898
return DateOnly.FromDateTime(dateTime);
9999
}
100100

101-
throw new NotSupportedException($"Cannot convert \"{dateTime}\" into {destinationType}");
101+
throw new NotImplementedException($"Cannot convert \"{dateTime}\" into {destinationType}");
102102
}
103103
}
104104

src/Controls/src/Core/TimeSpanTypeConverter.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public override object ConvertFrom(ITypeDescriptorContext? context, CultureInfo?
2929
{
3030
return result.ToTimeSpan();
3131
}
32-
throw new NotSupportedException($"Cannot convert \"{value}\" into {typeof(TimeSpan)}");
32+
throw new NotImplementedException($"Cannot convert \"{value}\" into {typeof(TimeSpan)}");
3333
}
3434

3535
public override object ConvertTo(ITypeDescriptorContext? context, CultureInfo? culture, object? value, Type? destinationType)
@@ -54,7 +54,7 @@ public override object ConvertTo(ITypeDescriptorContext? context, CultureInfo? c
5454
}
5555
}
5656

57-
throw new NotSupportedException($"Cannot convert \"{value}\" into {destinationType}");
57+
throw new NotImplementedException($"Cannot convert \"{value}\" into {destinationType}");
5858
}
5959

6060
static object ConvertToDestinationType(TimeOnly timeOnly, Type? destinationType, CultureInfo? culture)
@@ -72,7 +72,7 @@ static object ConvertToDestinationType(TimeOnly timeOnly, Type? destinationType,
7272
return timeOnly;
7373
}
7474

75-
throw new NotSupportedException($"Cannot convert \"{timeOnly}\" into {destinationType}");
75+
throw new NotImplementedException($"Cannot convert \"{timeOnly}\" into {destinationType}");
7676
}
7777

7878
static object ConvertToDestinationType(TimeSpan timeSpan, Type? destinationType, CultureInfo? culture)
@@ -90,7 +90,7 @@ static object ConvertToDestinationType(TimeSpan timeSpan, Type? destinationType,
9090
return TimeOnly.FromTimeSpan(timeSpan);
9191
}
9292

93-
throw new NotSupportedException($"Cannot convert \"{timeSpan}\" into {destinationType}");
93+
throw new NotImplementedException($"Cannot convert \"{timeSpan}\" into {destinationType}");
9494
}
9595
}
9696
#endif

src/Controls/tests/Core.UnitTests/DateOnlyTypeConverterTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ public void DateOnlyToStringCanConvertToDateTime()
2323
}
2424

2525
[Fact]
26-
public async Task ConvertToInvariantStringThrowsNotSupportedException()
26+
public async Task ConvertToInvariantStringThrowsNotImplementedException()
2727
{
2828
var converter = new DateTimeTypeConverter();
2929

3030
var stringValue = "Not a DateOnly string";
3131

32-
await Assert.ThrowsAsync<NotSupportedException>(async () => converter.ConvertToInvariantString(stringValue));
32+
await Assert.ThrowsAsync<NotImplementedException>(async () => converter.ConvertToInvariantString(stringValue));
3333
}
3434
}
3535
#endif

src/Controls/tests/Core.UnitTests/TimeOnlyTypeConverterTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ public void TimeOnlyToStringCanConvertToTimeSpan()
2323
}
2424

2525
[Fact]
26-
public async Task ConvertToInvariantStringThrowsNotSupportedException()
26+
public async Task ConvertToInvariantStringThrowsNotImplementedException()
2727
{
2828
var converter = new TimeSpanTypeConverter();
2929

3030
var stringValue = "Not a TimeOnly string";
3131

32-
await Assert.ThrowsAsync<NotSupportedException>(async () => converter.ConvertToInvariantString(stringValue));
32+
await Assert.ThrowsAsync<NotImplementedException>(async () => converter.ConvertToInvariantString(stringValue));
3333
}
3434
}
3535
#endif

0 commit comments

Comments
 (0)