-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathTransportTestsConfiguration.cs
More file actions
32 lines (25 loc) · 1.09 KB
/
TransportTestsConfiguration.cs
File metadata and controls
32 lines (25 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
namespace ServiceControl.Transport.Tests
{
using System;
using System.Threading.Tasks;
using ServiceControl.Infrastructure;
using ServiceControl.Transports.PostgreSql;
using Transports;
partial class TransportTestsConfiguration
{
public string ConnectionString { get; private set; }
public ITransportCustomization TransportCustomization { get; private set; }
public Task Configure()
{
TransportCustomization = new PostgreSqlTransportCustomization(LoggerUtil.CreateStaticLogger<PostgreSqlTransportCustomization>());
ConnectionString = Environment.GetEnvironmentVariable(ConnectionStringKey);
if (string.IsNullOrEmpty(ConnectionString))
{
throw new Exception($"Environment variable {ConnectionStringKey} is required for PostgreSQL transport tests to run");
}
return Task.CompletedTask;
}
public Task Cleanup() => Task.CompletedTask;
const string ConnectionStringKey = "ServiceControl_TransportTests_PostgreSQL_ConnectionString";
}
}