Repository: dotnet/efcore
File: test/EFCore.Sqlite.FunctionalTests/BuiltInDataTypesSqliteTest.cs (C#)

Code before:
    [ConditionalFact, UseCulture("tr-TR")] // #37432
    public virtual void Can_query_OrderBy_decimal_with_Turkish_culture()
    {
        using var context = CreateContext();
        var min = new BuiltInDataTypes
        {
            Id = 1,
            TestDecimal = 1.05m
        };
        context.Add(min);

        var middle = new BuiltInDataTypes
        {
            Id = 2,
            TestDecimal = 1.5m
        };
        context.Add(middle);

        var max = new BuiltInDataTypes
        {
            Id = 3,
            TestDecimal = 2.5m
        };
        context.Add(max);

        context.SaveChanges();

        var query = context.Set<BuiltInDataTypes>();

        var results = query
            .OrderBy(e => e.TestDecimal)
            .Select(e => new { e.Id, e.TestDecimal })
            .ToList();

        var expectedResults = query.AsEnumerable()
            .OrderBy(e => e.TestDecimal)
            .Select(e => new { e.Id, e.TestDecimal })
            .ToList();

        Assert.Equal(expectedResults.Count, results.Count);
        for (var i = 0; i < expectedResults.Count; i++)
        {
            Assert.Equal(expectedResults[i].Id, results[i].Id);
            Assert.Equal(expectedResults[i].TestDecimal, results[i].TestDecimal);
        }
    }

    [ConditionalFact]
    public virtual void Can_query_using_char_ToLower()
    {
        using var context = CreateContext();

Review comment (suggestion):
The test should follow the pattern established in other similar tests by calling `Fixture.TestSqlLoggerFactory.Clear()` after `SaveChanges()` to ensure the SQL log is cleared before executing the query whose SQL is being validated. This ensures that only the SQL from the query under test is captured.
```suggestion
        context.SaveChanges();
        Fixture.TestSqlLoggerFactory.Clear();
```

Code after:
    [ConditionalFact, UseCulture("tr-TR")] // #37432
    public virtual void Can_query_OrderBy_decimal_with_Turkish_culture()
    {
        using var context = CreateContext();
        var min = new BuiltInDataTypes
        {
            Id = 227,
            TestDecimal = 1.05m
        };
        context.Add(min);

        var middle = new BuiltInDataTypes
        {
            Id = 228,
            TestDecimal = 1.5m
        };
        context.Add(middle);

        var max = new BuiltInDataTypes
        {
            Id = 229,
            TestDecimal = 2.5m
        };
        context.Add(max);

        context.SaveChanges();
        Fixture.TestSqlLoggerFactory.Clear();

        var query = context.Set<BuiltInDataTypes>();

        var results = query
            .OrderBy(e => e.TestDecimal)
            .Select(e => new { e.Id, e.TestDecimal })
            .ToList();

        var expectedResults = query.AsEnumerable()
            .OrderBy(e => e.TestDecimal)
            .Select(e => new { e.Id, e.TestDecimal })
            .ToList();

        Assert.Equal(expectedResults, results);

        AssertSql(
            """
SELECT "b"."Id", "b"."TestDecimal"
FROM "BuiltInDataTypes" AS "b"
ORDER BY "b"."TestDecimal" COLLATE EF_DECIMAL
""",
                //
                """
SELECT "b"."Id", "b"."Enum16", "b"."Enum32", "b"."Enum64", "b"."Enum8", "b"."EnumS8", "b"."EnumU16", "b"."EnumU32", "b"."EnumU64", "b"."PartitionId", "b"."TestBoolean", "b"."TestByte", "b"."TestCharacter", "b"."TestDateOnly", "b"."TestDateTime", "b"."TestDateTimeOffset", "b"."TestDecimal", "b"."TestDouble", "b"."TestInt16", "b"."TestInt32", "b"."TestInt64", "b"."TestSignedByte", "b"."TestSingle", "b"."TestTimeOnly", "b"."TestTimeSpan", "b"."TestUnsignedInt16", "b"."TestUnsignedInt32", "b"."TestUnsignedInt64"