예제 #1
0
 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);
         }
     }
 }
예제 #2
0
        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);
                }
            }
        }
예제 #3
0
        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);
                }
            }
        }