public void SetUp() { mockLogger = Substitute.For <ILogger>(); mockParent = Substitute.For <IOpenKitComposite>(); mockBeacon = Substitute.For <IBeacon>(); mockBeacon.CreateTag(Arg.Any <int>(), Arg.Any <int>()).Returns(Tag); mockBeacon.NextSequenceNumber.Returns(SequenceNumber); }
/// <summary> /// Constructor for creating a new WebRequestTracer instance. /// </summary> /// <param name="logger">the logger used to log information.</param> /// <param name="parent">the parent object to which this web request tracer belongs to</param> /// <param name="beacon">the <see cref="Dynatrace.OpenKit.Protocol.Beacon"/> for sending data and tag creation</param> internal WebRequestTracer(ILogger logger, IOpenKitComposite parent, IBeacon beacon) { this.logger = logger; this.beacon = beacon; this.parent = parent; parentActionId = parent.ActionId; // creating start sequence number has to be done here, because it's needed for the creation of the tag StartSequenceNo = beacon.NextSequenceNumber; tag = beacon.CreateTag(parentActionId, StartSequenceNo); StartTime = beacon.CurrentTimestamp; }