public static IMqttApplication CreateThrowsDuringRequestProcessing(Func <Exception> exceptionFactory) => new MqttApplicationBuilder() .Use(MqttRequestDelegateHelper.Throws(exceptionFactory)) .Build();
public void ConfigureMqttApplication(IMqttApplicationBuilder mqttApplicationBuilder) { mqttApplicationBuilder.Map( $"test/builder_{BuilderNumber}/build_{BuildCount++}", MqttRequestDelegateHelper.Throws(() => new Exception($"{InvocationCount++}"))); }