Ejemplo n.º 1
0
        public void TestCreateLogEventInfoForOperationStarted()
        {
            var operationStarted = new OperationStarted(
                message: "my message",
                operationName: "operation name",
                tracerName: "tracer name",
                operationKind: OperationKind.Startup,
                operationId: "42",
                severity: Severity.Error);

            var log = NLogAdapter.CreateLogEventInfo(operationStarted);

            log.Properties.All(p => WellKnownProperties.Contains(p.Key.ToString())).Should().BeTrue();
        }
Ejemplo n.º 2
0
        public void TestCreateLogEventInfoForOperationResult()
        {
            var operationResult = new OperationResult(
                message: "my message",
                operationName: "operation name",
                tracerName: "tracer name",
                status: OperationStatus.Failure,
                duration: TimeSpan.FromSeconds(1),
                operationKind: OperationKind.Startup,
                exception: new Exception("Message"),
                operationId: "42",
                severity: Severity.Error);

            var log = NLogAdapter.CreateLogEventInfo(operationResult);

            log.Properties.All(p => WellKnownProperties.Contains(p.Key.ToString())).Should().BeTrue();
        }