public void Can_create_master_connection() { using (var connection = new MySqlConnection(CreateDependencies())) { using (var master = connection.CreateMasterConnection()) { Assert.Equal(@"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=master", master.ConnectionString); Assert.Equal(60, master.CommandTimeout); } } }
public void Master_connection_string_none_default_command_timeout() { var options = new DbContextOptionsBuilder() .UseMySql( @"Server=(localdb)\MSSQLLocalDB;Database=MySqlConnectionTest", b => b.CommandTimeout(55)) .Options; using (var connection = new MySqlConnection(CreateDependencies(options))) { using (var master = connection.CreateMasterConnection()) { Assert.Equal(55, master.CommandTimeout); } } }
public void Master_connection_string_contains_filename() { var options = new DbContextOptionsBuilder() .UseMySql( @"Server=(localdb)\MSSQLLocalDB;Database=MySqlConnectionTest;AttachDBFilename=C:\Narf.mdf", b => b.CommandTimeout(55)) .Options; using (var connection = new MySqlConnection(CreateDependencies(options))) { using (var master = connection.CreateMasterConnection()) { Assert.Equal(@"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=master", master.ConnectionString); } } }