Beispiel #1
0
        public async Task ShouldReturnNullWhenGlobalCheckpointNotSet()
        {
            // Act
            var result = await CheckpointManager.GetGlobalCheckpoint(CancellationToken.None).ConfigureAwait(false);

            // Assert
            result.ShouldBeNull();
        }
Beispiel #2
0
        public async Task ShouldSetGlobalCheckpointSuccessfullyWhenNull()
        {
            // Arrange
            long?checkpoint = null;

            // Act
            await CheckpointManager.SetGlobalCheckpoint(checkpoint).ConfigureAwait(false);

            // Assert
            var result = await CheckpointManager.GetGlobalCheckpoint().ConfigureAwait(false);

            result.ShouldBe(checkpoint);
        }
Beispiel #3
0
        public async Task ShouldSetGlobalCheckpoint()
        {
            // Arrange
            const long checkpoint = 100;

            // Act
            await CheckpointManager.SetGlobalCheckpoint(checkpoint).ConfigureAwait(false);

            // Assert
            var result = await CheckpointManager.GetGlobalCheckpoint().ConfigureAwait(false);

            result.ShouldBe(checkpoint);
        }
Beispiel #4
0
        public async Task ShouldReturnGlobalCheckpoint()
        {
            // Arrange
            const int checkpoint  = 100;
            var       checkpoints = typeof(CheckpointManager).GetField("Checkpoints", BindingFlags.Static | BindingFlags.NonPublic)?.GetValue(null) as IDictionary <string, long>;

            checkpoints?.Add(Constants.GlobalCheckpointId, checkpoint);

            // Act
            var result = await CheckpointManager.GetGlobalCheckpoint(CancellationToken.None).ConfigureAwait(false);

            // Assert
            result.ShouldBe(checkpoint);
        }