Ejemplo n.º 1
0
        public void UpdateConfiguration_WithMySqlServiceInfo_ReturnsExpected()
        {
            MySqlProviderConfigurer       configurer = new MySqlProviderConfigurer();
            MySqlProviderConnectorOptions config     = new MySqlProviderConnectorOptions()
            {
                Server   = "localhost",
                Port     = 1234,
                Username = "******",
                Password = "******",
                Database = "database"
            };
            MySqlServiceInfo si = new MySqlServiceInfo("MyId", "mysql://*****:*****@192.168.0.90:3306/cf_b4f8d2fa_a3ea_4e3a_a0e8_2cd040790355");

            configurer.UpdateConfiguration(si, config);

            Assert.Equal("192.168.0.90", config.Server);
            Assert.Equal(3306, config.Port);
            Assert.Equal("Dd6O1BPXUHdrmzbP", config.Username);
            Assert.Equal("7E1LxXnlH2hhlPVt", config.Password);
            Assert.Equal("cf_b4f8d2fa_a3ea_4e3a_a0e8_2cd040790355", config.Database);
        }
Ejemplo n.º 2
0
        public void UpdateConfiguration_WithNullMySqlServiceInfo_ReturnsExpected()
        {
            MySqlProviderConfigurer       configurer = new MySqlProviderConfigurer();
            MySqlProviderConnectorOptions config     = new MySqlProviderConnectorOptions()
            {
                Server   = "localhost",
                Port     = 1234,
                Username = "******",
                Password = "******",
                Database = "database"
            };

            configurer.UpdateConfiguration(null, config);

            Assert.Equal("localhost", config.Server);
            Assert.Equal(1234, config.Port);
            Assert.Equal("username", config.Username);
            Assert.Equal("password", config.Password);
            Assert.Equal("database", config.Database);
            Assert.Null(config.ConnectionString);
        }