public async Task CreateAsync_AccessRightsNotManage_DoesNotCreateTopicOrSubscription(AccessRights accessRights) { ServiceBusAccount account = new ServiceBusAccount(); Mock<ITriggeredFunctionExecutor> mockExecutor = new Mock<ITriggeredFunctionExecutor>(MockBehavior.Strict); ServiceBusSubscriptionListenerFactory factory = new ServiceBusSubscriptionListenerFactory(account, "testtopic", "testsubscription", mockExecutor.Object, accessRights, new ServiceBusConfiguration()); IListener listener = await factory.CreateAsync(CancellationToken.None); Assert.NotNull(listener); }
public Task<IListener> CreateListenerAsync(ListenerFactoryContext context) { if (context == null) { throw new ArgumentNullException("context"); } IListenerFactory factory = null; if (_queueName != null) { factory = new ServiceBusQueueListenerFactory(_account, _queueName, context.Executor, _accessRights); } else { factory = new ServiceBusSubscriptionListenerFactory(_account, _topicName, _subscriptionName, context.Executor, _accessRights); } return factory.CreateAsync(context.CancellationToken); }