Beispiel #1
0
        public void SaveTest2()
        {
            var dir = PathStringPool.Get("Temp/Logs");

            Directory.CreateDirectory(dir);
            using var cts  = new CancellationTokenSource();
            using var cts2 = new CancellationTokenSource();
            cts2.Cancel();
            var ex = new AggregateException(
                new Exception(),
                new NullReferenceException(),
                new DivideByZeroException(),
                new InvalidOperationException(),
                new InvalidDataException(),
                new InvalidPathFormatException("xyz"),
                new AccessViolationException(),
                new StackOverflowException(),
                new ObjectDisposedException("a"),
                new ArgumentNullException("b"),
                new OperationCanceledException(),
                new AggregateException(
                    new Exception(),
                    new Exception(),
                    new Exception("c", new Exception("d", new Exception("e",
                                                                        new OperationCanceledException(cts.Token)
                                                                        ))),
                    new SecurityException(),
                    new SecurityException(
                        "message",
                        this.GetType(),
                        "state"
                        ),
                    new SecurityException(
                        "message",
                        new Exception()
                        )
                    ),
                new OperationCanceledException(cts2.Token),
                new OperationCanceledException(CancellationToken.None)
                );

            ErrorReportBuilder.Create(ex).Save(dir, "FULL");
        }
Beispiel #2
0
 private static void SaveER(PathString dir, Exception ex)
 {
     ErrorReportBuilder.Create(ex).Save(dir, null);
 }
Beispiel #3
0
 public void CreateTest()
 {
     Assert.IsTrue(ErrorReportBuilder.Create(new Exception()) is ErrorReportBuilder);
 }