Exemplo n.º 1
0
        /// <inheritdoc />
        public virtual void FieldResolutionCompleted(FieldResolutionContext context)
        {
            if (!this.IsEnabled(LogLevel.Trace))
            {
                return;
            }

            var entry = new FieldResolutionCompletedLogEntry(context);

            this.LogEvent(LogLevel.Trace, entry);
        }
Exemplo n.º 2
0
        public void FieldResolutionCompletedLogEntry()
        {
            var server = new TestServerBuilder()
                         .AddGraphType <LogTestController>()
                         .Build();

            var package           = server.CreateFieldContextBuilder <LogTestController>(nameof(LogTestController.ExecuteField2));
            var resolutionContext = package.CreateResolutionContext();
            var fieldRequest      = package.FieldRequest;

            resolutionContext.Result = "15";

            var entry = new FieldResolutionCompletedLogEntry(resolutionContext);

            Assert.AreEqual(LogEventIds.FieldResolutionCompleted.Id, entry.EventId);
            Assert.AreEqual(fieldRequest.Id, entry.PipelineRequestId);
            Assert.AreEqual(fieldRequest.Field.Route.Path, entry.FieldPath);
            Assert.AreEqual(fieldRequest.Field.TypeExpression.ToString(), entry.TypeExpression);
            Assert.AreEqual(true, entry.HasData);
            Assert.AreEqual(true, entry.ResultIsValid);
            Assert.IsNotNull(entry.ToString());
        }