事件处理器单元测试 [英] Event Processor unit testing
问题描述
我试图为我的事件处理器编写单元测试,但是我不知道如何移动上下文对象.有什么建议.这是我正在测试的openasync方法
公共任务OpenAsync(PartitionContext上下文) { _log.LogInformation(在{ConsumerGroup}-{Partition}处打开事件处理器", context.ConsumerGroupName, context.PartitionId); 返回Task.CompletedTask; }
https://stackoverflow.com/questions/tagged/azure-eventhub
这将帮助您更快地答复查询.
--------------- -------------------------------------------------- ------------------------------
如果此答案有帮助,请单击"标记为答案"或"投票".要提供有关您的论坛体验的其他反馈,请单击 在这里 >>
Hi,
I m trying to write unit test for my eventprocessor but I dont know how to moc context object. Any suggestions. This is openasync method I m testing
public Task OpenAsync(PartitionContext context) { _log.LogInformation("Opening Event Processor at {ConsumerGroup}-{Partition}", context.ConsumerGroupName, context.PartitionId); return Task.CompletedTask; }解决方案The query posted by you has not reached the right forum. In order to assist best on your query, I would request you to post your query in SO => Azure Event Hub dedicated support. Additionally, adding the [Azure] tag on SO will increase visibility as it is a Microsoft Sponsored tag.
https://stackoverflow.com/questions/tagged/azure-eventhub
This will assist you with a faster reply to your query.
-----------------------------------------------------------------------------------------------
If this answer was helpful, click "Mark as Answer" or "Up-Vote". To provide additional feedback on your forum experience, click here
这篇关于事件处理器单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!