Exemple #1
0
        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));
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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]);
        }