Beispiel #1
0
        public void ShouldGenerateNpgsqlConnectionStringWithDefaultValues()
        {
            var details    = new ConnectionDetails();
            var connection = details.ToNpgsqlSConnectionString();

            connection
            .Should()
            .Be(
                "User ID=;Password=;Server=;Port=5432;Database=;Pooling=true;SSL Mode=Prefer;Trust Server Certificate=true");
        }
Beispiel #2
0
        public void ShouldGenerateNpgsqlConnectionStringWithSpecifiedValues()
        {
            var host     = "localhost";
            var user     = "******";
            var password = "******";
            var port     = 3310;
            var database = "database";

            var details    = new ConnectionDetails(host, user, password, database, port);
            var connection = details.ToNpgsqlSConnectionString();

            connection
            .Should()
            .Be(
                $"User ID={user};Password={password};Server={host};Port={port};Database={database};Pooling=true;SSL Mode=Prefer;Trust Server Certificate=true");
        }