Esempio n. 1
0
        public async Task Get_CurrentCsv_Returns_Unicode_Encoded_Csv()
        {
            //Arrange - a broken link in both a system and an interface
            PurgeBrokenExternalReferencesReportTable();
            var system = await ItSystemHelper.CreateItSystemInOrganizationAsync(A <Guid>().ToString("N"), TestEnvironment.DefaultOrganizationId, AccessModifier.Public);

            var systemReferenceName = A <string>();
            await ReferencesHelper.CreateReferenceAsync(systemReferenceName, null, SystemReferenceUrl, Display.Url, r => r.ItSystem_Id = system.Id);

            var interfaceDto = await InterfaceHelper.CreateInterface(InterfaceHelper.CreateInterfaceDto(A <string>(), A <string>(), TestEnvironment.DefaultOrganizationId, AccessModifier.Public));

            interfaceDto = await InterfaceHelper.SetUrlAsync(interfaceDto.Id, InterfaceUrl);

            //Act
            await BrokenExternalReferencesReportHelper.TriggerRequestAsync();

            var dto = await WaitForReportGenerationCompletedAsync();

            //Assert that the two controlled errors are present
            Assert.True(dto.Available);
            var report = await GetBrokenLinksReportAsync();

            var brokenSystemLink = Assert.Single(report[system.Name]);

            AssertBrokenLinkRow(brokenSystemLink, "IT System", system.Name, systemReferenceName, "Se fejlkode", "404", SystemReferenceUrl);
            var brokenInterfaceLink = Assert.Single(report[interfaceDto.Name]);

            AssertBrokenLinkRow(brokenInterfaceLink, "Snitflade", interfaceDto.Name, string.Empty, "Se fejlkode", "404", InterfaceUrl);
        }
Esempio n. 2
0
        public async Task Can_Delete_Objects_Which_Are_Referred_By_Report()
        {
            //Arrange - a broken link in both a system and an interface
            PurgeBrokenExternalReferencesReportTable();
            var system = await ItSystemHelper.CreateItSystemInOrganizationAsync(A <Guid>().ToString("N"), TestEnvironment.DefaultOrganizationId, AccessModifier.Public);

            await ReferencesHelper.CreateReferenceAsync(A <string>(), null, SystemReferenceUrl, Display.Url, r => r.ItSystem_Id = system.Id);

            var referenceToBeExplicitlyDeleted = await ReferencesHelper.CreateReferenceAsync(A <string>(), null, SystemReferenceUrl, Display.Url, r => r.ItSystem_Id = system.Id);

            var interfaceDto = await InterfaceHelper.CreateInterface(InterfaceHelper.CreateInterfaceDto(A <string>(), A <string>(), TestEnvironment.DefaultOrganizationId, AccessModifier.Public));

            interfaceDto = await InterfaceHelper.SetUrlAsync(interfaceDto.Id, InterfaceUrl);

            await BrokenExternalReferencesReportHelper.TriggerRequestAsync();

            var dto = await WaitForReportGenerationCompletedAsync();

            Assert.True(dto.Available);

            //Act
            using (var deleteReferenceResponse = await ReferencesHelper.DeleteReferenceAsync(referenceToBeExplicitlyDeleted.Id))
                using (var deleteItSystemResponse = await ItSystemHelper.DeleteItSystemAsync(system.Id, TestEnvironment.DefaultOrganizationId))
                    using (var deleteInterfaceResponse = await InterfaceHelper.SendDeleteInterfaceRequestAsync(interfaceDto.Id))
                    {
                        Assert.Equal(HttpStatusCode.OK, deleteReferenceResponse.StatusCode);
                        Assert.Equal(HttpStatusCode.OK, deleteItSystemResponse.StatusCode);
                        Assert.Equal(HttpStatusCode.OK, deleteInterfaceResponse.StatusCode);
                    }
        }
Esempio n. 3
0
        public async Task After_Job_Completes_Status_Returns_AvailableReport()
        {
            //Arrange
            PurgeBrokenExternalReferencesReportTable();

            //Act
            await BrokenExternalReferencesReportHelper.TriggerRequestAsync();

            var dto = await WaitForReportGenerationCompletedAsync();

            //Assert
            Assert.True(dto.Available);
            Assert.NotNull(dto.BrokenLinksCount);
            Assert.NotNull(dto.CreatedDate);
        }