public void Build_IgnoresSamePriorityNames()
        {
            Assert.IsFalse(_candidateTransactionName.TrySet(TransactionName.ForWebTransaction("newCategory", "newName"), 0));

            var builtName = _candidateTransactionName.CurrentTransactionName;

            NrAssert.Multiple
            (
                () => Assert.AreEqual("initialCategory", builtName.Category),
                () => Assert.AreEqual("initialName", builtName.Name)
            );
        }
        public void Build_IgnoresNamesAddedAfterFreezing()
        {
            _candidateTransactionName.Freeze(TransactionNameFreezeReason.CrossApplicationTracing);
            Assert.IsFalse(_candidateTransactionName.TrySet(TransactionName.ForWebTransaction("newCategory", "newName"), TransactionNamePriority.FrameworkHigh));

            var builtName = _candidateTransactionName.CurrentTransactionName;

            NrAssert.Multiple
            (
                () => Assert.AreEqual("initialCategory", builtName.Category),
                () => Assert.AreEqual("initialName", builtName.Name)
            );
        }
        public void Build_UsesHighestPriorityName()
        {
            _candidateTransactionName.TrySet(TransactionName.ForWebTransaction("newCategory", "newName"), TransactionNamePriority.Route);

            var builtName = _candidateTransactionName.CurrentTransactionName;

            NrAssert.Multiple
            (

                () => Assert.AreEqual("newCategory", builtName.Category),
                () => Assert.AreEqual("newName", builtName.Name)
            );
        }
        public void Build_IgnoresLowerPriorityNames()
        {
            Assert.IsTrue(_candidateTransactionName.TrySet(TransactionName.ForWebTransaction("newCategory3", "newName3"), TransactionNamePriority.Handler));
            Assert.IsFalse(_candidateTransactionName.TrySet(TransactionName.ForWebTransaction("newCategory2", "newName2"), TransactionNamePriority.StatusCode));

            var builtName = _candidateTransactionName.CurrentTransactionName;

            NrAssert.Multiple
            (

                () => Assert.AreEqual("newCategory3", builtName.Category),
                () => Assert.AreEqual("newName3", builtName.Name)
            );
        }
 public void SetUp()
 {
     _initialTransactionName   = TransactionName.ForWebTransaction("initialCategory", "initialName");
     _candidateTransactionName = new CandidateTransactionName(Mock.Create <ITransaction>(), _initialTransactionName);
 }
예제 #6
0
 public ImmutableTransactionBuilder IsOtherTransaction(string category, string name)
 {
     _transactionName = TransactionName.ForOtherTransaction(category, name);
     return(this);
 }
예제 #7
0
        public static TransactionName ForUriTransaction(string normalizedUri)
        {
            var trxName = new TransactionName(true, MetricNames.Uri, normalizedUri);

            return(trxName);
        }
예제 #8
0
        public static TransactionName ForWebTransaction(string type, string name)
        {
            var trxName = new TransactionName(true, type, name);

            return(trxName);
        }
예제 #9
0
        public static TransactionName ForOtherTransaction(string category, string name)
        {
            var trxName = new TransactionName(false, category, name);

            return(trxName);
        }