diff --git a/tests/Schemio.EntityFramework.Tests/Customer.db b/tests/Schemio.EntityFramework.Tests/Customer.db index 1d5c292..82716c1 100644 Binary files a/tests/Schemio.EntityFramework.Tests/Customer.db and b/tests/Schemio.EntityFramework.Tests/Customer.db differ diff --git a/tests/Schemio.EntityFramework.Tests/CustomerDbContext.cs b/tests/Schemio.EntityFramework.Tests/CustomerDbContext.cs index 93a31f3..225b9c7 100644 --- a/tests/Schemio.EntityFramework.Tests/CustomerDbContext.cs +++ b/tests/Schemio.EntityFramework.Tests/CustomerDbContext.cs @@ -1,3 +1,4 @@ +using System.Globalization; using Microsoft.EntityFrameworkCore; using Schemio.Core.Helpers; using Schemio.EntityFramework.Tests.Domain; @@ -54,7 +55,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) eb.HasKey(b => b.OrderId); eb.Property(b => b.OrderNo); eb.Property(b => b.Date).HasColumnName("OrderDate") - .HasConversion(v => v.ToShortDateString(), s => s.IsNotNullOrEmpty() ? DateTime.ParseExact(s, "dd/MM/yyyy", null) : DateTime.MinValue); + .HasConversion(v => v.ToShortDateString(), s => s.IsNotNullOrEmpty() ? DateTime.ParseExact(s, "dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture) : DateTime.MinValue); eb.HasOne(b => b.Customer); eb.HasMany(b => b.Items); }); diff --git a/tests/Schemio.EntityFramework.Tests/E2E.Tests.cs b/tests/Schemio.EntityFramework.Tests/E2E.Tests.cs index 860c2b0..da03464 100644 --- a/tests/Schemio.EntityFramework.Tests/E2E.Tests.cs +++ b/tests/Schemio.EntityFramework.Tests/E2E.Tests.cs @@ -47,7 +47,7 @@ public void TestDataProviderToFetchWholeEntityWhenPathsAreNull() Orders = [ new Order { OrderId = 1, OrderNo = "ZX123VH", - Date = DateTime.Parse("2021-10-22T00:00:00"), + Date = DateTime.Parse("2021-10-22T12:13:04"), Items = [ new OrderItem @@ -117,7 +117,7 @@ public void TestDataProviderToFetchEntityWhenPathsContainsOrderItems() { OrderId = 1, OrderNo = "ZX123VH", - Date = DateTime.Parse("2021-10-22T00:00:00"), + Date = DateTime.Parse("2021-10-22T12:13:04"), Items = [ new OrderItem diff --git a/tests/Schemio.SQL.Tests/Customer.db b/tests/Schemio.SQL.Tests/Customer.db index 1d5c292..da2682c 100644 Binary files a/tests/Schemio.SQL.Tests/Customer.db and b/tests/Schemio.SQL.Tests/Customer.db differ diff --git a/tests/Schemio.SQL.Tests/E2E.Tests.cs b/tests/Schemio.SQL.Tests/E2E.Tests.cs index 23dc60d..2fd1f5f 100644 --- a/tests/Schemio.SQL.Tests/E2E.Tests.cs +++ b/tests/Schemio.SQL.Tests/E2E.Tests.cs @@ -48,7 +48,7 @@ public void TestDataProviderToFetchWholeEntityWhenPathsAreNull() Orders = [ new Order { OrderId = 1, OrderNo = "ZX123VH", - Date = DateTime.Parse("2021-10-22T00:00:00"), + Date = DateTime.Parse("2021-10-22T12:13:04"), Items = [ new OrderItem @@ -84,7 +84,7 @@ public void TestDataProviderToFetchEntityWhenPathsContainsOrderItems() { OrderId = 1, OrderNo = "ZX123VH", - Date = DateTime.Parse("2021-10-22T00:00:00"), + Date = DateTime.Parse("2021-10-22T12:13:04"), Items = [ new OrderItem diff --git a/tests/Schemio.SQL.Tests/EntitySetup/EntityConfiguration/Transforms/OrdersTransform.cs b/tests/Schemio.SQL.Tests/EntitySetup/EntityConfiguration/Transforms/OrdersTransform.cs index c11a122..47306f3 100644 --- a/tests/Schemio.SQL.Tests/EntitySetup/EntityConfiguration/Transforms/OrdersTransform.cs +++ b/tests/Schemio.SQL.Tests/EntitySetup/EntityConfiguration/Transforms/OrdersTransform.cs @@ -1,3 +1,4 @@ +using System.Globalization; using Schemio.Core; using Schemio.SQL.Tests.EntitySetup.Entities; using Schemio.SQL.Tests.EntitySetup.EntitySchemas.Queries; @@ -19,7 +20,7 @@ public override void Transform(CollectionResult collectionResult, C { customer.Orders[index] = new Order { - Date = DateTime.Parse(collectionResult[index].OrderDate), + Date = DateTime.ParseExact(collectionResult[index].OrderDate, "dd/MM/yyyy HH:mm:ss", CultureInfo.InvariantCulture), OrderId = collectionResult[index].OrderId, OrderNo = collectionResult[index].OrderNo };