Skip to content

Commit c08c7aa

Browse files
committed
fix: update MySql EF tests to use native provider (remove Pomelo references)
1 parent 2f7e915 commit c08c7aa

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

tests/CosmoSQLClient.MySql.Tests/EntityFrameworkCoreTests.cs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,30 @@
11
using Microsoft.EntityFrameworkCore;
2-
using Microsoft.EntityFrameworkCore.Infrastructure;
3-
using Pomelo.EntityFrameworkCore.MySql.Infrastructure;
42

53
namespace CosmoSQLClient.MySql.Tests;
64

75
public class EntityFrameworkCoreTests
86
{
9-
private static readonly ServerVersion ServerVersion = new MySqlServerVersion(new Version(8, 0, 0));
10-
117
[Fact]
128
public void UseCosmoMySql_WithConnectionString_ShouldConfigureMySqlConnection()
139
{
1410
var options = new DbContextOptionsBuilder<TestDbContext>()
15-
.UseCosmoMySql("Host=localhost;Database=sampledb;User Id=root;Password=password;", ServerVersion)
11+
.UseCosmoMySql("Host=localhost;Database=sampledb;User Id=root;Password=password;",
12+
ServerVersion.AutoDetect(""))
1613
.Options;
1714

1815
using var context = new TestDbContext(options);
1916
Assert.IsType<MySqlConnection>(context.Database.GetDbConnection());
2017
}
2118

2219
[Fact]
23-
public void UseCosmoMySql_WithExistingConnection_ShouldReuseConnection()
20+
public void UseMySql_WithConnectionString_ShouldConfigureMySqlConnection()
2421
{
25-
using var connection = new MySqlConnection("Host=localhost;Database=sampledb;User Id=root;Password=password;");
26-
2722
var options = new DbContextOptionsBuilder<TestDbContext>()
28-
.UseCosmoMySql(connection, ServerVersion)
23+
.UseMySql("Host=localhost;Database=sampledb;User Id=root;Password=password;")
2924
.Options;
3025

3126
using var context = new TestDbContext(options);
32-
Assert.Same(connection, context.Database.GetDbConnection());
27+
Assert.IsType<MySqlConnection>(context.Database.GetDbConnection());
3328
}
3429

3530
private sealed class TestDbContext(DbContextOptions<TestDbContext> options) : DbContext(options)

0 commit comments

Comments
 (0)