Exemple #1
0
        public void Correct_GetTraceIdFromHeader()
        {
            var httpContextAccessor = MockServicesHelper.CreateHttpContextAccessor(requestHeaders: MockStaticData.RequestHeadersWithTrackIds);
            var traceIdGenerator    = new HttpHeaderTraceIdGenerator(httpContextAccessor);

            Assert.AreEqual(traceIdGenerator.GenerateTraceId(), MockStaticData.TraceId);
        }
Exemple #2
0
        public void ThrowException_GetTraceIdFromHeader()
        {
            var traceIdGenerator = new HttpHeaderTraceIdGenerator(MockServicesHelper.CreateHttpContextAccessor());

            Assert.Throws <NullReferenceException>(() => traceIdGenerator.GenerateTraceId());
        }