protected override void DoSetUp() { DropSagaTables(); persister = new PostgreSqlSagaPersister(GetOrCreateConnection, SagaIndexTableName, SagaTableName); persister.EnsureTablesAreCreated(); }
public IStoreSagaData CreatePersister() { const string sagaTableName = "test_sagas"; const string sagaIndexTableName = "test_saga_index"; var sqlServerSagaPersister = new PostgreSqlSagaPersister(ConnectionStrings.PostgreSql, sagaIndexTableName, sagaTableName); sqlServerSagaPersister.EnsureTablesAreCreated(); DeleteRows(sagaTableName); DeleteRows(sagaIndexTableName); return sqlServerSagaPersister; }
public IStoreSagaData CreatePersister() { const string sagaTableName = "test_sagas"; const string sagaIndexTableName = "test_saga_index"; var sqlServerSagaPersister = new PostgreSqlSagaPersister(ConnectionStrings.PostgreSql, sagaIndexTableName, sagaTableName); sqlServerSagaPersister.EnsureTablesAreCreated(); DeleteRows(sagaTableName); DeleteRows(sagaIndexTableName); return(sqlServerSagaPersister); }
public void WhenIgnoringNullProperties_DoesNotSaveNullPropertiesOnUpdate() { persister.EnsureTablesAreCreated() .DoNotIndexNullProperties(); const string correlationProperty1 = "correlation property 1"; const string correlationProperty2 = "correlation property 2"; var correlationPropertyPaths = new[] { Reflect.Path <PieceOfSagaData>(s => s.SomeProperty), Reflect.Path <PieceOfSagaData>(s => s.AnotherProperty) }; var firstPieceOfSagaDataWithNullValueOnProperty = new PieceOfSagaData { SomeProperty = correlationProperty1, AnotherProperty = "random12423" }; var nextPieceOfSagaDataWithNullValueOnProperty = new PieceOfSagaData { SomeProperty = correlationProperty2, AnotherProperty = "random38791387" }; persister.Insert(firstPieceOfSagaDataWithNullValueOnProperty, correlationPropertyPaths); persister.Insert(nextPieceOfSagaDataWithNullValueOnProperty, correlationPropertyPaths); var firstPiece = persister.Find <PieceOfSagaData>(Reflect.Path <PieceOfSagaData>(s => s.SomeProperty), correlationProperty1); firstPiece.AnotherProperty = null; persister.Update(firstPiece, correlationPropertyPaths); var nextPiece = persister.Find <PieceOfSagaData>(Reflect.Path <PieceOfSagaData>(s => s.SomeProperty), correlationProperty2); nextPiece.AnotherProperty = null; persister.Update(nextPiece, correlationPropertyPaths); }