public void PushScope_Parameterless_NoOp() { var scopeGuard = SentryCore.PushScope(); Assert.False(SentryCore.IsEnabled); scopeGuard.Dispose(); }
public void PushScope_NullArgument_NoOp() { var scopeGuard = SentryCore.PushScope(null as object); Assert.False(SentryCore.IsEnabled); scopeGuard.Dispose(); }
public void EnabledSdk_PushScope_AddBreadcrumb_PopScope() { using (SentryCore.PushScope()) { for (int i = 0; i < BreadcrumbsCount; i++) { SentryCore.AddBreadcrumb( Message, Type, Category, Data, Level); } } }
public void Invoke(dynamic request) { using (SentryCore.PushScope()) { SentryCore.AddBreadcrumb(request.Path, "request-path"); // Change the SentryClient in case the request is to the admin part: if (request.Path.StartsWith("/admin")) { // Within this scope, the _adminClient will be used instead of whatever // client was defined before this point: SentryCore.BindClient(_adminClient); } SentryCore.CaptureException(new Exception("Error at the admin section")); // Else it uses the default client _middleware?.Invoke(request); } // Scope is disposed. }
public IDisposable PushScope <TState>(TState state) => SentryCore.PushScope(state);
public IDisposable PushScope() => SentryCore.PushScope();
public void PushScope_MultiCallParameterless_SameDisposableInstance() => Assert.Same(SentryCore.PushScope(), SentryCore.PushScope());
public void PushScope_MultiCallState_SameDisposableInstance() { var state = new object(); Assert.Same(SentryCore.PushScope(state), SentryCore.PushScope(state)); }
public void PushScope_InstanceOf_DisabledClient() { Assert.Same(Sentry.Internals.DisabledSentryClient.Instance, SentryCore.PushScope()); }
public void PushScope_InstanceOf_DisabledClient() { Assert.Same(DisabledHub.Instance, SentryCore.PushScope()); }