Пример #1
0
        public async Task Get_Status_Returns_ReportNotAvailable()
        {
            //Arrange
            PurgeBrokenExternalReferencesReportTable();

            //Act
            var dto = await BrokenExternalReferencesReportHelper.GetStatusAsync();

            //Assert
            Assert.NotNull(dto);
            Assert.False(dto.Available);
            Assert.Null(dto.BrokenLinksCount);
            Assert.Null(dto.CreatedDate);
        }
Пример #2
0
        private static async Task <BrokenExternalReferencesReportStatusDTO> WaitForReportGenerationCompletedAsync()
        {
            var beginning = DateTime.Now;
            var waitedFor = DateTime.Now.Subtract(beginning);
            BrokenExternalReferencesReportStatusDTO dto;

            do
            {
                dto = await BrokenExternalReferencesReportHelper.GetStatusAsync();

                if (!dto.Available)
                {
                    await Task.Delay(TimeSpan.FromSeconds(1));
                }
                waitedFor = DateTime.Now.Subtract(beginning);
            } while (dto.Available == false && waitedFor < TimeSpan.FromMinutes(1));

            return(dto);
        }