Beispiel #1
0
        public void PushScope_Parameterless_NoOp()
        {
            var scopeGuard = SentryCore.PushScope();

            Assert.False(SentryCore.IsEnabled);
            scopeGuard.Dispose();
        }
Beispiel #2
0
        public void PushScope_NullArgument_NoOp()
        {
            var scopeGuard = SentryCore.PushScope(null as object);

            Assert.False(SentryCore.IsEnabled);
            scopeGuard.Dispose();
        }
Beispiel #3
0
 public void EnabledSdk_PushScope_AddBreadcrumb_PopScope()
 {
     using (SentryCore.PushScope())
     {
         for (int i = 0; i < BreadcrumbsCount; i++)
         {
             SentryCore.AddBreadcrumb(
                 Message,
                 Type,
                 Category,
                 Data,
                 Level);
         }
     }
 }
Beispiel #4
0
            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.
            }
Beispiel #5
0
 public IDisposable PushScope <TState>(TState state)
 => SentryCore.PushScope(state);
Beispiel #6
0
 public IDisposable PushScope()
 => SentryCore.PushScope();
Beispiel #7
0
 public void PushScope_MultiCallParameterless_SameDisposableInstance() => Assert.Same(SentryCore.PushScope(), SentryCore.PushScope());
Beispiel #8
0
        public void PushScope_MultiCallState_SameDisposableInstance()
        {
            var state = new object();

            Assert.Same(SentryCore.PushScope(state), SentryCore.PushScope(state));
        }
Beispiel #9
0
 public void PushScope_InstanceOf_DisabledClient()
 {
     Assert.Same(Sentry.Internals.DisabledSentryClient.Instance, SentryCore.PushScope());
 }
Beispiel #10
0
 public void PushScope_InstanceOf_DisabledClient()
 {
     Assert.Same(DisabledHub.Instance, SentryCore.PushScope());
 }