public void Unregister_DoesntCrashifNotRegistered() { //Arrange var integration = new NativeIntegration(new SentryXamarinOptions()); //Act integration.Unregister(); }
internal static bool RegisterNativeIntegrations(this SentryXamarinOptions options) { if (options.NativeIntegrationEnabled) { #if NATIVE_PROCESSOR var nativeintegration = new NativeIntegration(options); options.AddIntegration(nativeintegration); return(true); #else options.DiagnosticLogger?.Log(SentryLevel.Debug, "No NativeIntegration found for the given target."); #endif } return(false); }
public void Handle_RegisterUnhandleException() { //Arrange var integration = new NativeIntegration(new SentryXamarinOptions()); var hub = new MockHub(); integration.Register(hub, new SentryOptions()); //Act try { integration.Handle(new Exception()); } finally { integration.Unregister(); } //Assert Assert.Equal(1, hub.CaptureEventCount); Assert.Equal(1, hub.FlushAsyncCount); }