Esempio n. 1
0
        public async Task DisableQueueSuccessTest()
        {
            InternalQueueManagementV1 result;
            IEnumerable <InternalQueueManagementV1> list;
            var context = _workContext.WithTag(_tag);

            list = await _management.GetQueueList(context, false);

            list.Should().NotBeNull();
            list.Count().Should().Be(0);

            list = await _management.GetQueueList(context, true);

            list.Should().NotBeNull();
            list.Count().Should().Be(0);

            const string queueName = "test-queue";
            await _management.SetQueue(context, queueName, 10, 11, 12);

            list = await _management.GetQueueList(context, false);

            list.Should().NotBeNull();
            list.Count().Should().Be(1);

            result = await _management.GetQueue(context, queueName);

            result.Should().NotBeNull();
            result.QueueName.Should().Be(queueName);

            await _management.DisableQueue(context, queueName);

            result = await _management.GetQueue(context, queueName);

            result.Should().BeNull();

            list = await _management.GetQueueList(context, true);

            list.Should().NotBeNull();
            list.Count().Should().Be(1);
            result = list.First();
            result.QueueName.Should().Be(queueName);
            result.Disable.Should().BeTrue();

            await _management.EnableQueue(context, queueName);

            result = await _management.GetQueue(context, queueName);

            result.Should().NotBeNull();
            result.QueueName.Should().Be(queueName);

            list = await _management.GetQueueList(context, false);

            list.Should().NotBeNull();
            list.Count().Should().Be(1);
        }
Esempio n. 2
0
        public async Task <IActionResult> EnableQueue(string queueName)
        {
            Verify.IsNotEmpty(nameof(queueName), queueName);

            RequestContext requestContext = this.HttpContext.GetRequestContext();
            var            context        = requestContext.Context.WithTag(_tag);

            await _management.EnableQueue(context, queueName);

            return(new StandardActionResult(context));
        }