public void Configure_NoServiceInfo_ReturnsExpected()
        {
            var config = new OracleProviderConnectorOptions()
            {
                Server      = "localhost",
                Port        = 1234,
                Username    = "******",
                Password    = "******",
                ServiceName = "orcl"
            };

            var configurer       = new OracleProviderConfigurer();
            var opts             = configurer.Configure(null, config);
            var connectionString = string.Format("User Id={0};Password={1};Data Source={2}:{3}/{4};", config.Username, config.Password, config.Server, config.Port, config.ServiceName);

            Assert.StartsWith(connectionString, opts);
        }
        public void UpdateConfiguration_WithNullOracleServiceInfo_ReturnsExpected()
        {
            var configurer = new OracleProviderConfigurer();
            var config     = new OracleProviderConnectorOptions()
            {
                Server      = "localhost",
                Port        = 1234,
                Username    = "******",
                Password    = "******",
                ServiceName = "orcl"
            };

            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("orcl", config.ServiceName);
            Assert.Null(config.ConnectionString);
        }
        public void UpdateConfiguration_WithOracleServiceInfo_ReturnsExpected()
        {
            var configurer = new OracleProviderConfigurer();
            var config     = new OracleProviderConnectorOptions()
            {
                Server      = "localhost",
                Port        = 1234,
                Username    = "******",
                Password    = "******",
                ServiceName = "orcl"
            };
            var si = new OracleServiceInfo("MyId", "oracle://*****:*****@localhost:1521/orclpdb1");

            configurer.UpdateConfiguration(si, config);

            Assert.Equal("localhost", config.Server);
            Assert.Equal(1521, config.Port);
            Assert.Equal("user", config.Username);
            Assert.Equal("pwd", config.Password);
            Assert.Equal("orclpdb1", config.ServiceName);
        }
        public void Configure_ServiceInfoOveridesConfig_ReturnsExpected()
        {
            OracleProviderConnectorOptions config = new OracleProviderConnectorOptions()
            {
                Server      = "localhost",
                Port        = 1234,
                Username    = "******",
                Password    = "******",
                ServiceName = "orcl"
            };

            OracleProviderConfigurer configurer = new OracleProviderConfigurer();
            OracleServiceInfo        si         = new OracleServiceInfo("MyId", "oracle://*****:*****@localhost:1521/orclpdb1");

            _ = configurer.Configure(si, config);

            Assert.Equal("localhost", config.Server);
            Assert.Equal(1521, config.Port);
            Assert.Equal("user", config.Username);
            Assert.Equal("pwd", config.Password);
            Assert.Equal("orclpdb1", config.ServiceName);
        }