public void Arrange()
        {
            _executor       = new Mock <ITriggeredFunctionExecutor>();
            _attribute      = new NServiceBusTriggerAttribute();
            _options        = new NServiceBusOptions();
            _listener       = new TestListener(_executor.Object, _attribute, null, _options);
            _messageContext = new MessageContext("1", new Dictionary <string, string>(), new byte[] { 1, 2, 3 }, new TransportTransaction(), new CancellationTokenSource(), new ContextBag());

            _executor.Setup(e => e.TryExecuteAsync(It.IsAny <TriggeredFunctionData>(), It.IsAny <CancellationToken>()))
            .ReturnsAsync(new FunctionResult(true));
        }
 public NServiceBusListener(
     ITriggeredFunctionExecutor executor,
     NServiceBusTriggerAttribute attribute,
     ParameterInfo parameter,
     NServiceBusOptions nServiceBusOptions = null)
 {
     _executor           = executor;
     _attribute          = attribute;
     _parameter          = parameter;
     _poisonMessageQueue = $"{attribute.Endpoint}-Error";
     _nServiceBusOptions = nServiceBusOptions ?? new NServiceBusOptions();
 }
 public void Arrange()
 {
     _parameterInfo = typeof(TestClass).GetMethod("TestMethod").GetParameters().First();
     _attribute     = _parameterInfo.GetCustomAttribute <NServiceBusTriggerAttribute>();
     _binding       = new NServiceBusTriggerBinding(_parameterInfo, _attribute);
 }
 public TestListener(ITriggeredFunctionExecutor contextExecutor, NServiceBusTriggerAttribute attribute, ParameterInfo parameter, NServiceBusOptions options) : base(contextExecutor, attribute, parameter, options)
 {
 }
 public NServiceBusTriggerBinding(ParameterInfo parameter, NServiceBusTriggerAttribute attribute, NServiceBusOptions nServiceBusOptions = null)
 {
     Parameter           = parameter;
     Attribute           = attribute;
     _nServiceBusOptions = nServiceBusOptions ?? new NServiceBusOptions();
 }