Skip to content

Commit

Permalink
Use decimal directly in Northwind SQLite tests
Browse files Browse the repository at this point in the history
They are now supported sufficiently well.
  • Loading branch information
ranma42 committed Feb 9, 2025
1 parent c8c0647 commit b23c8bb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public override async Task Client_evaluation_of_uncorrelated_method_call(bool as
"""
SELECT "o"."OrderID", "o"."ProductID", "o"."Discount", "o"."Quantity", "o"."UnitPrice"
FROM "Order Details" AS "o"
WHERE "o"."UnitPrice" < 7.0 AND 10 < "o"."ProductID"
WHERE ef_compare("o"."UnitPrice", '7.0') < 0 AND 10 < "o"."ProductID"
""");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ public class NorthwindQuerySqliteFixture<TModelCustomizer> : NorthwindQueryRelat
protected override ITestStoreFactory TestStoreFactory
=> SqliteNorthwindTestStoreFactory.Instance;

protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context)
{
base.OnModelCreating(modelBuilder, context);

// NB: SQLite doesn't support decimal very well. Using double instead
modelBuilder.Entity<OrderDetail>().Property(o => o.UnitPrice).HasConversion<double>();
modelBuilder.Entity<Product>().Property(o => o.UnitPrice).HasConversion<double?>();
}

protected override Type ContextType
=> typeof(NorthwindSqliteContext);
}

0 comments on commit b23c8bb

Please sign in to comment.