public void Can_store_and_read_checkpoint(long?checkpoint)
        {
            _checkpointStore.Write(checkpoint);
            var returned = _checkpointStore.Read();

            returned.ShouldBe(checkpoint);
        }
 public void Can_store_and_read_by_readonly(long?checkpoint)
 {
     _checkpointStore.Write(checkpoint);
     using (var readonlyStore = new CheckpointStore(_filePath, true))
     {
         var returned = readonlyStore.Read();
         returned.ShouldBe(checkpoint);
     }
 }
Esempio n. 3
0
        public CheckpointProjection(
            IStatefulProjection inner,
            CheckpointStore checkpointStore,
            Action <AllStreamPosition> notifyCheckpoint = null)
        {
            _inner            = inner;
            _checkpointStore  = checkpointStore;
            _notifyCheckpoint = notifyCheckpoint;

            _lastCheckpoint = _checkpointStore.Read();
            _notifyCheckpoint?.Invoke(AllStreamPosition.FromNullableInt64(_lastCheckpoint));
        }