public TextMapPropagationRegistryTests() { _propagationRegistry = Propagators.TextMap; _baggage = new Dictionary <string, string> { { "key1", "value1/val" }, { "key2", "value2/val" } }; _spanContext = Substitute.For <ILetsTraceSpanContext>(); _format = Substitute.For <IFormat <ITextMap> >(); _spanContext.GetBaggageItems().Returns(_baggage); }
public Span(ILetsTraceTracer tracer, string operationName, ILetsTraceSpanContext context, DateTime?startTimestampUtc = null, Dictionary <string, object> tags = null, List <Reference> references = null) { Tracer = tracer ?? throw new ArgumentNullException(nameof(tracer)); if (string.IsNullOrEmpty(operationName)) { var nullOrEmpty = operationName == null ? "null" : "empty"; throw new ArgumentException($"Argument is {nullOrEmpty}", nameof(operationName)); } OperationName = operationName; Context = context ?? throw new ArgumentNullException(nameof(context)); StartTimestampUtc = startTimestampUtc ?? Tracer.Clock.UtcNow(); Tags = tags ?? new Dictionary <string, object>(); References = references ?? Enumerable.Empty <Reference>(); }