Esempio n. 1
0
        public void When_generating_system_report_with_flag()
        {
            var report = DiagnosticReport.Generate(DiagnosticReportType.System);

            report.ShouldNotBeNull();
            report.Timestamp.ShouldBeLessThanOrEqualTo(DateTimeOffset.Now);
            report.TimeTaken.ShouldBeGreaterThan(0.Milliseconds());
            report.Type.ShouldBe(DiagnosticReportType.System);
            report.SystemDetails.ShouldNotBeNull();
            report.ProcessDetails.ShouldBeNull();
            report.DriveDetails.ShouldBeNull();
            report.DriveDetails.ShouldBeNull();
            report.Assemblies.ShouldBeNull();
            report.EnvironmentVariables.ShouldBeNull();
            report.NetworkingDetails.ShouldBeNull();

            var formattedReport = report.ToString();

            formattedReport.ShouldNotBeNull();
            formattedReport.Length.ShouldBeGreaterThan(100);

            formattedReport.ShouldStartWith("/\r\n|Diagnostic Report generated at:");
            formattedReport.ShouldContain("\r\n|\r\n|System|...");
            formattedReport.ShouldNotContain("\r\n|\r\n|Process|...");
            formattedReport.ShouldNotContain("\r\n|\r\n|Drives|...");
            formattedReport.ShouldNotContain("\r\n|\r\n|Assemblies|...");
            formattedReport.ShouldNotContain("\r\n|\r\n|Environment-Variables|...");
            formattedReport.ShouldNotContain("\r\n|\r\n|Networks|...");
            formattedReport.ShouldNotContain("|\r\n|\t. Windows IP Configuration\r\n|");
            formattedReport.ShouldEndWith("\\");
        }
Esempio n. 2
0
        public void When_generating_drives_report_with_flag()
        {
            var report = DiagnosticReport.Generate(DiagnosticReportType.Drives);

            report.ShouldNotBeNull();
            report.Length.ShouldBeGreaterThan(100);

            report.ShouldStartWith("/\r\n|Diagnostic Report generated at:");
            report.ShouldNotContain("\r\n|\r\n|System|...");
            report.ShouldNotContain("\r\n|\r\n|Process|...");
            report.ShouldContain("\r\n|\r\n|Drives|...");
            report.ShouldNotContain("\r\n|\r\n|Assemblies|...");
            report.ShouldNotContain("\r\n|\r\n|Environment-Variables|...");
            report.ShouldNotContain("\r\n|\r\n|Networking|...");
            report.ShouldNotContain("|\r\n|\t. Windows IP Configuration\r\n|");
            report.ShouldEndWith("\\");
        }
Esempio n. 3
0
        public void When_generating_full_report_with_flag()
        {
            // ReSharper disable once RedundantArgumentDefaultValue
            var report = DiagnosticReport.Generate(DiagnosticReportType.Full);

            report.ShouldNotBeNull();
            report.Length.ShouldBeGreaterThan(1000);

            report.ShouldStartWith("/\r\n|Diagnostic Report generated at:");
            report.ShouldContain("\r\n|\r\n|System|...");
            report.ShouldContain("\r\n|\r\n|Process|...");
            report.ShouldContain("\r\n|\r\n|Drives|...");
            report.ShouldContain("\r\n|\r\n|Assemblies|...");
            report.ShouldContain("\r\n|\r\n|Environment-Variables|...");
            report.ShouldContain("\r\n|\r\n|Networking|...");
            report.ShouldContain("|\r\n|\t. Windows IP Configuration\r\n|");
            report.ShouldEndWith("\\");
        }
Esempio n. 4
0
        public void When_generating_process_and_assemblies_and_networking_and_full_report()
        {
            var flags = DiagnosticReportType.Process
                        | DiagnosticReportType.Assemblies
                        | DiagnosticReportType.Networking
                        | DiagnosticReportType.Full;

            var report = DiagnosticReport.Generate(flags);

            report.ShouldNotBeNull();
            report.Length.ShouldBeGreaterThan(1000);

            report.ShouldStartWith("/\r\n|Diagnostic Report generated at:");
            report.ShouldContain("\r\n|\r\n|System|...");
            report.ShouldContain("\r\n|\r\n|Process|...");
            report.ShouldContain("\r\n|\r\n|Drives|...");
            report.ShouldContain("\r\n|\r\n|Assemblies|...");
            report.ShouldContain("\r\n|\r\n|Environment-Variables|...");
            report.ShouldContain("\r\n|\r\n|Networking|...");
            report.ShouldContain("|\r\n|\t. Windows IP Configuration\r\n|");
            report.ShouldEndWith("\\");
        }