entvex commented on code in PR #162:
URL: https://github.com/apache/pulsar-dotpulsar/pull/162#discussion_r1293204793


##########
tests/DotPulsar.Tests/ConsumerTests.cs:
##########
@@ -70,6 +70,154 @@ public async Task 
Messages_GivenTopicWithMessages_ShouldConsumeAll(int numberOfM
         consumed.Should().BeEquivalentTo(produced);
     }
 
+    [Fact]
+    public async Task 
GetLastMessageId_GivenPartitionedTopic_ShouldThrowException()
+    {
+        //Arrange
+        var testRunId = Guid.NewGuid().ToString("N");
+        const int partitions = 3;
+        var topicName = 
$"persistent://public/default/consumer-tests-{testRunId}";
+
+        _fixture.CreatePartitionedTopic(topicName, partitions);
+
+        await using var client = PulsarClient.Builder()
+            .ServiceUrl(_fixture.ServiceUrl)
+            .Authentication(AuthenticationFactory.Token(ct => 
ValueTask.FromResult(_fixture.CreateToken(Timeout.InfiniteTimeSpan))))
+            .Build();
+
+        var consumer = client.NewConsumer(Schema.ByteArray)
+            .ConsumerName($"consumer-{testRunId}")
+            .InitialPosition(SubscriptionInitialPosition.Earliest)
+            .SubscriptionName($"subscription-{testRunId}")
+            .Topic(topicName)
+            .Create();
+
+        //Act
+        var exception = await Record.ExceptionAsync(() => 
consumer.GetLastMessageId().AsTask());
+
+        //Assert
+        exception.Should().BeOfType<NotSupportedException>();
+    }
+
+    [Fact]
+    public async Task 
Receive_GivenPartitionedTopicWithMessages_ShouldReceiveAll()

Review Comment:
   I'll rename it to 
Receive_GivenNonPartitionedTopicWithMessages_ShouldReceiveAll :)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to