示例#1
0
    public async Task Can_Update_Redrive_Policy()
    {
        // Arrange
        int maximumReceives = 42;

        ILoggerFactory    loggerFactory = OutputHelper.ToLoggerFactory();
        IAwsClientFactory clientFactory = CreateClientFactory();

        var client = clientFactory.GetSqsClient(Region);

        var queue = new SqsQueueByName(
            Region,
            UniqueName,
            client,
            1,
            loggerFactory);

        await queue.CreateAsync(new SqsBasicConfiguration());

        // Act
        await queue.UpdateRedrivePolicyAsync(
            new RedrivePolicy(maximumReceives, queue.ErrorQueue.Arn));

        // Assert
        queue.RedrivePolicy.ShouldNotBeNull();
        queue.RedrivePolicy.MaximumReceives.ShouldBe(maximumReceives);
    }