Example #1
0
        public void BacktraceMetricsUniqueEvent_ShouldPreventFromUpdatingAttributeWhenUniqueAttributeValueIsEmpty_UniqueEventIsUpdated()
        {
            const int    nextTime             = 1000;
            const string uniqueEventName      = "BacktraceMetricsUniqueEvent_ShouldPreventFromUpdatingAttributeWhenUniqueAttributeValueIsEmpty_UniqueEventIsUpdated";
            var          attributeProvider    = new AttributeProvider();
            var          timestamp            = DateTimeHelper.Timestamp();
            var          expectedNewTimestamp = timestamp + nextTime;

            attributeProvider[uniqueEventName] = uniqueEventName;
            var attributes = attributeProvider.GenerateAttributes();

            var uniqueEvent = new UniqueEvent(uniqueEventName, timestamp, attributes);

            attributeProvider[uniqueEventName] = string.Empty;

            uniqueEvent.UpdateTimestamp(expectedNewTimestamp, attributeProvider.GenerateAttributes());

            Assert.AreEqual(uniqueEventName, uniqueEvent.Attributes[uniqueEventName]);
        }