public void Build_DoesNotIncludeCatParameter_IfCatResponseDataIsNotSet() { var segment = new Segment(TransactionSegmentStateHelpers.GetItransactionSegmentState(), new MethodCallData("foo", "bar", 1)); segment.SetSegmentData(new ExternalSegmentData(new Uri("http://www.google.com"), "method")); Assert.IsFalse(segment.Parameters.ToDictionary().ContainsKey(TransactionGuidSegmentParameterKey)); }
public void End_WithException_HasErrorData() { var segment = new Segment(TransactionSegmentStateHelpers.GetItransactionSegmentState(), new MethodCallData("Type", "Method", 1)); segment.End(new Exception("Unhandled exception")); Assert.IsNotNull(segment.ErrorData); Assert.AreEqual("System.Exception", segment.ErrorData.ErrorTypeName); Assert.AreEqual("Unhandled exception", segment.ErrorData.ErrorMessage); }
public void Build_IncludesCatParameter_IfCatResponseDataIsSet() { var segment = new Segment(TransactionSegmentStateHelpers.GetItransactionSegmentState(), new MethodCallData("foo", "bar", 1)); segment.SetSegmentData(new ExternalSegmentData(new Uri("http://www.google.com"), "method", new CrossApplicationResponseData("cpId", "name", 1.1f, 2.2f, 3, "guid", false))); segment.End(); Assert.IsTrue(segment.Parameters.ToDictionary().ContainsKey(TransactionGuidSegmentParameterKey)); Assert.AreEqual("guid", segment.Parameters.ToDictionary()[TransactionGuidSegmentParameterKey]); }