public async Task AssertHttpRetryWorksCorrectly()
        {
            // Arrange - Setup the handler for the mocked HTTP call
            _isRetryCalled = false;
            _retryCount    = 0;

            mockHttpMessageHandler.Protected()
            .Setup <Task <HttpResponseMessage> >("SendAsync", ItExpr.IsAny <HttpRequestMessage>(), ItExpr.IsAny <CancellationToken>())
            .ReturnsAsync(() =>
            {
                if (_isRetryCalled)
                {
                    return(new HttpResponseMessage()
                    {
                        StatusCode = HttpStatusCode.OK
                    });
                }
                else
                {
                    return(new HttpResponseMessage()
                    {
                        StatusCode = HttpStatusCode.TooManyRequests
                    });
                }
            });


            var client = new HttpClient(mockHttpMessageHandler.Object);

            mockFactory.Setup(_ => _.CreateClient(It.IsAny <string>())).Returns(client);

            // Arrange - Setup the Service/Poco details
            MediumService mediumService = new MediumService(mockFactory.Object, mockLogger.Object);
            MediumPoco    mediumPoco    = new MediumPoco()
            {
                content      = "#Test My Test",
                canonicalUrl = "https://www.cloudwithchris.com",
                tags         = new List <string>()
                {
                    "DevOps", "GitHub"
                },
                title = "Descriptive Title"
            };
            Mock <CancellationTokenSource> mockCancellationTokenSource = new Mock <CancellationTokenSource>();

            // Act
            await GetRetryPolicyAsync().ExecuteAsync(async() =>
            {
                return(await mediumService.CreatePostAsync(mediumPoco, "integrationToken", mockCancellationTokenSource.Object, "myAuthorId"));
            });

            // Assert
            Assert.True(_isRetryCalled);
            Assert.Equal(1, _retryCount);
        }