public void IsWatermarkAchievedByFailsOnNullResult()
        {
            // Arrange
            var topicName = new TopicName("Test");
            var offsets   = new WatermarkOffsets(new Offset(1), new Offset(2));
            var partition = new Partition(1);

            ConsumeResult <object, object> result = null !;

            var pw = new PartitionWatermark(topicName, offsets, partition);

            // Act
            var exception = Record.Exception(() => pw.IsWatermarkAchievedBy(result));

            // Assert
            exception.Should().NotBeNull().And.BeOfType <ArgumentNullException>();
        }
        public void IsWatermarkAchievedByReatcsOnNotRightOffset()
        {
            // Arrange
            var topicName = new TopicName("Test");
            var offsets   = new WatermarkOffsets(new Offset(1), new Offset(2));
            var partition = new Partition(1);

            var result = new ConsumeResult <object, object>()
            {
                Offset = offsets.Low
            };

            var pw     = new PartitionWatermark(topicName, offsets, partition);
            var status = false;

            // Act
            var exception = Record.Exception(() => status = pw.IsWatermarkAchievedBy(result));

            // Assert
            exception.Should().BeNull();
            status.Should().BeFalse();
        }