public Fixture() { var options = new SentryOptions { TracesSampleRate = 1.0 }; ScopeManager = new SentryScopeManager( new AsyncLocalScopeStackContainer(), options, Substitute.For <ISentryClient>() ); Hub = Substitute.For <IHub>(); Hub.GetSpan().ReturnsForAnyArgs(_ => GetSpan()); Hub.StartTransaction(Arg.Any <ITransactionContext>(), Arg.Any <IReadOnlyDictionary <string, object> >()) .ReturnsForAnyArgs(callinfo => StartTransaction(Hub, callinfo.Arg <ITransactionContext>())); Hub.When(hub => hub.ConfigureScope(Arg.Any <Action <Scope> >())) .Do(callback => callback.Arg <Action <Scope> >().Invoke(ScopeManager.GetCurrent().Key)); DiagnosticListener.AllListeners.Subscribe(new SentryDiagnosticSubscriber(Hub, options)); _database = new Database(); _database.Seed(); }
public ScopeSnapshot( SentryOptions options, KeyValuePair <Scope, ISentryClient>[] snapshot, SentryScopeManager scopeManager) { _options = options; _snapshot = snapshot; _scopeManager = scopeManager; }
public Fixture() { var options = new SentryOptions(); ScopeManager = new SentryScopeManager( new AsyncLocalScopeStackContainer(), options, Substitute.For <ISentryClient>() ); Hub = Substitute.For <IHub>(); Hub.GetSpan().ReturnsForAnyArgs((_) => GetSpan()); Hub.StartTransaction(Arg.Any <ITransactionContext>(), Arg.Any <IReadOnlyDictionary <string, object> >()) .ReturnsForAnyArgs(callinfo => StartTransaction(Hub, callinfo.Arg <ITransactionContext>())); DiagnosticListener.AllListeners.Subscribe(new SentryDiagnosticSubscriber(Hub, options)); _database = new Database(); _database.Seed(); }
public void IterationSetup() => _scopeManager = new SentryScopeManager(new SentryOptions(), DisabledSentryClient.Instance);