Skip to content

Commit

Permalink
Add some tests around date/time mappings (#3432)
Browse files Browse the repository at this point in the history
  • Loading branch information
roji authored Jan 12, 2025
1 parent c2b3de4 commit 49e4a86
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/EFCore.PG.Tests/Storage/NpgsqlTypeMappingSourceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 28,11 @@ public class NpgsqlTypeMappingSourceTest
[InlineData("varchar(8)", typeof(string), 8, null, null, false)]
[InlineData("varchar", typeof(string), null, null, null, false)]
[InlineData("timestamp with time zone", typeof(DateTime), null, null, null, false)]
[InlineData("timestamp without time zone", typeof(DateTime), null, null, null, false)]
[InlineData("date", typeof(DateOnly), null, null, null, false)]
[InlineData("time", typeof(TimeOnly), null, null, null, false)]
[InlineData("time without time zone", typeof(TimeOnly), null, null, null, false)]
[InlineData("interval", typeof(TimeSpan), null, null, null, false)]
[InlineData("dummy", typeof(DummyType), null, null, null, false)]
[InlineData("int4range", typeof(NpgsqlRange<int>), null, null, null, false)]
[InlineData("floatrange", typeof(NpgsqlRange<float>), null, null, null, false)]
Expand Down Expand Up @@ -107,6 112,10 @@ public void Timestamp_without_time_zone_Array_5()
[InlineData(typeof(int), "integer")]
[InlineData(typeof(int[]), "integer[]")]
[InlineData(typeof(byte[]), "bytea")]
[InlineData(typeof(DateTime), "timestamp with time zone")]
[InlineData(typeof(DateOnly), "date")]
[InlineData(typeof(TimeOnly), "time without time zone")]
[InlineData(typeof(TimeSpan), "interval")]
[InlineData(typeof(DummyType), "dummy")]
[InlineData(typeof(NpgsqlRange<int>), "int4range")]
[InlineData(typeof(NpgsqlRange<float>), "floatrange")]
Expand Down Expand Up @@ -160,6 169,10 @@ public void By_ClrType_and_element_precision(Type clrType, string expectedStoreT
[InlineData("integer", typeof(int))]
[InlineData("numeric", typeof(float))]
[InlineData("numeric", typeof(double))]
[InlineData("date", typeof(DateOnly))]
[InlineData("date", typeof(DateTime))]
[InlineData("time", typeof(TimeOnly))]
[InlineData("time", typeof(TimeSpan))]
[InlineData("integer[]", typeof(int[]))]
[InlineData("integer[]", typeof(List<int>))]
[InlineData("smallint[]", typeof(byte[]))]
Expand Down

0 comments on commit 49e4a86

Please sign in to comment.