public void BugSplat_Post_ShouldPostMinidumpToBugSplat() { var sut = new BugSplat("fred", "myConsoleCrasher", "2021.4.23.0"); var minidumpFileInfo = new FileInfo("minidump.dmp"); sut.MinidumpType = BugSplat.MinidumpTypeId.WindowsNative; sut.Description = "Default description - overridden"; sut.Email = "[email protected] - overridden"; sut.User = "******"; sut.Key = "Default - overridden"; var options = new MinidumpPostOptions() { MinidumpType = BugSplat.MinidumpTypeId.UnityNativeWindows, Description = "BugSplat rocks!", Email = "*****@*****.**", User = "******", Key = "the key!" }; options.AdditionalAttachments.Add(new FileInfo("attachment.txt")); var response = sut.Post(minidumpFileInfo, options).Result; var body = response.Content.ReadAsStringAsync().Result; Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); }
public void BugSplat_Post_ShouldPostExceptionToBugSplat() { try { new Foo(new Bar(new Baz())).SampleStackFrame(); } catch (Exception ex) { var sut = new BugSplat("fred", "MyDotNetStandardCrasher", "1.0"); sut.ExceptionType = BugSplat.ExceptionTypeId.Unity; sut.Description = "Default description - overridden"; sut.Email = "[email protected] - overridden"; sut.User = "******"; sut.Key = "Default - overridden"; var options = new ExceptionPostOptions() { ExceptionType = BugSplat.ExceptionTypeId.DotNetStandard, Description = "BugSplat rocks!", Email = "*****@*****.**", User = "******", Key = "the key!" }; options.AdditionalAttachments.Add(new FileInfo("attachment.txt")); var response = sut.Post(ex, options).Result; var body = response.Content.ReadAsStringAsync().Result; Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); } }
public void BugSplat_Post_ShouldPostStackTraceToBugSplat() { var sut = new BugSplat("fred", "MyUnityCrasher", "1.0"); sut.ExceptionType = BugSplat.ExceptionTypeId.Unity; sut.Description = "Default description - overridden"; sut.Email = "[email protected] - overridden"; sut.User = "******"; sut.Key = "Default - overridden"; var stackTrace = @"Exception: BugSplat rocks! Main.ThrowException () (at Assets/Main.cs:75) Main.SampleStackFrame2 () (at Assets/Main.cs:95) Main.SampleStackFrame1 () (at Assets/Main.cs:90) Main.SampleStackFrame0 () (at Assets/Main.cs:85) Main.GenerateSampleStackFramesAndThrow () (at Assets/Main.cs:80) Main.Update() (at Assets/Main.cs:69)"; var options = new ExceptionPostOptions() { ExceptionType = BugSplat.ExceptionTypeId.UnityLegacy, Description = "BugSplat rocks!", Email = "*****@*****.**", User = "******", Key = "the key!" }; options.AdditionalAttachments.Add(new FileInfo("attachment.txt")); var response = sut.Post(stackTrace, options).Result; var body = response.Content.ReadAsStringAsync().Result; Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); }
public void BugSplat_Post_ShouldThrowIfMinidumpFileInfoIsNull() { Assert.ThrowsAsync <ArgumentNullException>(async() => { FileInfo fileInfo = null; var bugsplat = new BugSplat("fred", "my-app", "1.0.0"); await bugsplat.Post(fileInfo); }); }
public void BugSplat_Post_ShouldThrowIfExIsNull() { Assert.ThrowsAsync <ArgumentNullException>(async() => { Exception ex = null; var bugsplat = new BugSplat("fred", "my-app", "1.0.0"); await bugsplat.Post(ex); }); }
public void BugSplat_Post_ShouldThrowIfStackTraceFileInfoIsNull() { Assert.ThrowsAsync <ArgumentNullException>(async() => { string stackTrace = null; var bugsplat = new BugSplat("fred", "my-app", "1.0.0"); await bugsplat.Post(stackTrace); }); }
/// <summary> /// Initializes the singleton application object. This is the first line of authored code /// executed, and as such is the logical equivalent of main() or WinMain(). /// </summary> public App() { this.InitializeComponent(); this.Suspending += OnSuspending; this.UnhandledException += async(sender, args) => { args.Handled = true; await BugSplat.Post(args.Exception); CoreApplication.Exit(); }; TaskScheduler.UnobservedTaskException += async(sender, args) => { await BugSplat.Post(args.Exception); CoreApplication.Exit(); }; }