(string ip, int port, string user, string password)
| 13 | private List<Test> tests = new List<Test>(); |
| 14 | |
| 15 | public void Connect(string ip, int port, string user, string password) |
| 16 | { |
| 17 | string connectionString = $"Host={ip};Port={port};Username={user};Password={password};Database=postgres;Timeout=300;CommandTimeout=600;"; |
| 18 | try |
| 19 | { |
| 20 | conn = new NpgsqlConnection(connectionString); |
| 21 | conn.Open(); |
| 22 | cmd = conn.CreateCommand(); |
| 23 | cmd.CommandType = CommandType.Text; |
| 24 | } |
| 25 | catch (NpgsqlException e) |
| 26 | { |
| 27 | throw new Exception($"Error connecting to database: {e.Message}", e); |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | public void Disconnect() |
| 32 | { |
no outgoing calls
no test coverage detected