我正在尝试为 azure timer 触发函数创建 Xunit 测试,我必须在 Run 方法中传递服务总线客户端队列,我无法模拟服务总线队列并且不确定如何作为参数传递
下面是我的天蓝色功能
[FunctionName("TimerJob")]
public static async Task Run([TimerTrigger("%TimerJobExpression%")] TimerInfo myTimer,
[ServiceBus("%Queue1%", Connection = "ServiceBusConnection")] IAsyncCollector<string> Queue1,
[ServiceBus("%Queue2%", Connection = "ServiceBusConnection")] IAsyncCollector<string> Queue2,
ILogger log)
{
//logic
}
下面是我正在尝试创建的测试方法
[Fact]
public async Task Run_Queue()
{
var param1 = default(TimerInfo);
var result = await ProducerClientTimerJob.Run(param1, null, null, logger);
}