public void EnterActionWithNullActionNameGivesNullRootActionObject() { // given var target = CreateSession().Build(); mockBeacon.ClearReceivedCalls(); // when var obtained = target.EnterAction(null); // then Assert.That(obtained, Is.Not.Null.And.TypeOf <NullRootAction>()); mockLogger.Received(1).Warn("Session [sn=0, seq=0] EnterAction: actionName must not be null or empty"); mockLogger.DidNotReceive().Debug(Arg.Any <string>()); }
public void StartDoesNothingIfAlreadyStopped() { // given var target = CreateWebRequestTracer().Build(); const long timestamp = 12345; mockBeacon.CurrentTimestamp.Returns(timestamp); target.Stop(); mockBeacon.ClearReceivedCalls(); // when starting web request tracing var obtained = target.Start(); // then Assert.That(target.StartTime, Is.EqualTo(0L)); Assert.That(mockBeacon.ReceivedCalls(), Is.Empty); Assert.That(obtained, Is.SameAs(target)); }