public PostgresCheckpointManagerTests() { var fixture = new Fixture(); _options = fixture.Build <PostgresOptions>() .Without(o => o.Host) .Without(o => o.Port) .Without(o => o.Database) .Without(o => o.Username) .Without(o => o.Password) .Without(o => o.Pooling) .Without(o => o.Schema) .Do(o => { o.Host = Environment.GetEnvironmentVariable("POSTGRES_HOST") ?? "localhost"; o.Port = Convert.ToInt32(Environment.GetEnvironmentVariable("POSTGRES_PORT") ?? "5432"); o.Database = Environment.GetEnvironmentVariable("POSTGRES_DATABASE") ?? "postgres"; o.Username = Environment.GetEnvironmentVariable("POSTGRES_USERNAME") ?? "postgres"; o.Password = Environment.GetEnvironmentVariable("POSTGRES_PASSWORD") ?? "postgres"; o.Pooling = Convert.ToBoolean(Environment.GetEnvironmentVariable("POSTGRES_POOLING") ?? "False"); o.Schema = Environment.GetEnvironmentVariable("POSTGRES_SCHEMA") ?? "public"; }) .Create(); _connection = new PostgresConnection(_options); _sut = new PostgresCheckpointManager(_options, _connection); }
public PostgresCheckpointManager(PostgresOptions options, IPostgresConnection connection) { _options = options ?? throw new ArgumentNullException(nameof(options)); _scripts = new Scripts.Scripts(_options.Schema); _createConnection = connection.Build; CreateSchemaIfNotExists(); }
public IndexModule(IPostgresConnection connection, IApplicationStateRepository appStateRepository) { var getIndexVmCommand = new GetIndexVmCommand(appStateRepository); var districtsRepository = new DistrictsRepository(connection); var schoolsRepository = new SchoolsRepository(connection); Get["/"] = _ => View["index", getIndexVmCommand.Execute()]; Get["/districts"] = _ => GetAllDistricts(districtsRepository); Get["/districts/{districtId}"] = parameters => GetDistrict(districtsRepository, schoolsRepository, parameters); }
protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines) { base.ApplicationStartup(container, pipelines); appStateRepository = new ApplicationStateRepository(); container.Register(appStateRepository); connection = new PostgresConnection(appStateRepository.GetPrimaryConnectionString()); container.Register(connection); StaticConfiguration.DisableErrorTraces = !appStateRepository.GetRequiredSetting("showErrorTraces").AsBool(); }
public PostgresReadModelUnitOfWorkTests() { fixture = new Fixture(); transaction = Substitute.For <IPostgresTransaction>(); connection = Substitute.For <IPostgresConnection>(); connection.BeginTransaction().Returns(transaction); connectionFactory = Substitute.For <IPostgresConnectionFactory>(); connectionFactory.Create(Arg.Any <PostgresConfiguration>()).Returns(connection); }
public PostgresReadModelUserRepositoryTests() { fixture = new Fixture(); parameterCollection = Substitute.For <IPostgresParameterCollection>(); command = Substitute.For <IPostgresCommand>(); transaction = Substitute.For <IPostgresTransaction>(); connection = Substitute.For <IPostgresConnection>(); command.CreateParameter().Returns(args => Substitute.For <IPostgresParameter>()); command.Parameters.Returns(parameterCollection); connection.CreateCommand().Returns(command); connection.BeginTransaction().Returns(transaction); repository = new PostgresReadModelUserRepository(connection); }
public WorldCupRepositoryCSharpV1(IPostgresConnection postgresConnection) { _postgresConnection = postgresConnection; }
public PostgresReadModelUserRepository(IPostgresConnection connection) { Connection = connection; }
public TraderDocumentsPostgresRepository(IPostgresConnection postgresConnection) { _postgresConnection = postgresConnection ?? throw new ArgumentNullException(nameof(postgresConnection)); }
public TodoRepository(IPostgresConnection conn) { _conn = conn; }
public ImageRepository(IPostgresConnection connection, IMapper mapper) { this.Connection = connection; this.Mapper = mapper; }
public EventRepository(IPostgresConnection connection, IMapper mapper) { this.Mapper = mapper; this.Connection = connection; }
public WorldCupController2(IPostgresConnection postgresConnection) { _postgresConnection = postgresConnection; }
public PersonalDataPostgresRepository(IPostgresConnection postgresConnection) { _postgresConnection = postgresConnection ?? throw new ArgumentNullException(nameof(postgresConnection)); }
public DarkSkyLogRepository(IPostgresConnection postgresConnection) { this.postgresConnection = postgresConnection; }
public AuthenticationCredentialsPostgresRepository(IPostgresConnection postgresConnection, byte[] initKey, byte[] initVector) { _postgresConnection = postgresConnection ?? throw new ArgumentNullException(nameof(postgresConnection)); _initKey = initKey; _initVector = initVector; }
public DistrictsRepository(IPostgresConnection connection) { this.connection = connection; }
public SchoolsRepository(IPostgresConnection connection) { this.connection = connection; }
public ToDoItemRepository(IPostgresConnection connection) { this.connection = connection; }
public MiniPonicsImageDataRepository(IPostgresConnection postgresConnection) { this.postgresConnection = postgresConnection; }