Beispiel #1
0
        public void GetErrorTrace_ReturnsErrorTrace_IfExceptionIsNoticed()
        {
            var errorDataIn           = _errorService.FromMessage("My message", (Dictionary <string, object>)null, false);
            var transaction           = BuildTestTransaction(uri: "http://www.newrelic.com/test?param=value", transactionExceptionDatas: new[] { errorDataIn });
            var attributes            = new AttributeValueCollection(AttributeDestinations.ErrorTrace);
            var transactionMetricName = new TransactionMetricName("WebTransaction", "Name");

            var errorTrace = _errorTraceMaker.GetErrorTrace(transaction, attributes, transactionMetricName);

            Assert.NotNull(errorTrace);
            NrAssert.Multiple(
                () => Assert.AreEqual("WebTransaction/Name", errorTrace.Path),
                () => Assert.AreEqual("My message", errorTrace.Message),
                () => Assert.AreEqual("Custom Error", errorTrace.ExceptionClassName),
                () => Assert.AreEqual(transaction.Guid, errorTrace.Guid)
                );
        }