'GetMessagesBatch' unit tests #264
-
Hi everyone, I'm writing a middleware that processes messages in batch, and I'm having some troubles writing unit tests for it, since I haven't figured out how to mock the 'IMessageContext' in a way where I can call the 'GetMessagesBatch' method. Has anyone faced a similar challenge? Is there any way to do this with mocks, or this isn't the way to go? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @diogod3 , we are planning a refactor on BatchConsume to solve this problem in the future v3. |
Beta Was this translation helpful? Give feedback.
Hi @diogod3 , we are planning a refactor on BatchConsume to solve this problem in the future v3.
With the current implementation, you could create a class that receives a list of messages and the middleware calls your class, doing this way you can test your class directly.