public async Task CheckpointUpdateDoesNotInterfereWithOtherNamespaces() { var partitionManager = new MockCheckPointStorage(); await partitionManager.UpdateCheckpointAsync(new Checkpoint ("namespace1", "eventHubName", "consumerGroup", "partitionId", 10, 20)); await partitionManager.UpdateCheckpointAsync(new Checkpoint ("namespace2", "eventHubName", "consumerGroup", "partitionId", 10, 20)); IEnumerable <Checkpoint> storedCheckpointsList1 = await partitionManager.ListCheckpointsAsync("namespace1", "eventHubName", "consumerGroup"); IEnumerable <Checkpoint> storedCheckpointsList2 = await partitionManager.ListCheckpointsAsync("namespace2", "eventHubName", "consumerGroup"); Assert.That(storedCheckpointsList1, Is.Not.Null); Assert.That(storedCheckpointsList1.Count, Is.EqualTo(1)); Assert.That(storedCheckpointsList2, Is.Not.Null); Assert.That(storedCheckpointsList2.Count, Is.EqualTo(1)); }
public async Task CheckpointUpdateDoesNotInterfereWithOtherPartitions() { var partitionManager = new MockCheckPointStorage(); await partitionManager.UpdateCheckpointAsync(new Checkpoint ("namespace", "eventHubName", "consumerGroup", "partitionId1", 10, 20)); await partitionManager.UpdateCheckpointAsync(new Checkpoint ("namespace", "eventHubName", "consumerGroup", "partitionId2", 10, 20)); IEnumerable <Checkpoint> storedCheckpointsList = await partitionManager.ListCheckpointsAsync("namespace", "eventHubName", "consumerGroup"); Assert.That(storedCheckpointsList, Is.Not.Null); Assert.That(storedCheckpointsList.Count, Is.EqualTo(2)); Checkpoint storedCheckpoint1 = storedCheckpointsList.First(checkpoint => checkpoint.PartitionId == "partitionId1"); Checkpoint storedCheckpoint2 = storedCheckpointsList.First(checkpoint => checkpoint.PartitionId == "partitionId2"); Assert.That(storedCheckpoint1, Is.Not.Null); Assert.That(storedCheckpoint2, Is.Not.Null); }