コード例 #1
0
        public void Should_save_OperationContextValue_as_vector_of_strings()
        {
            var builder = new HerculesEventBuilder();

            sink.Put(stream, Arg.Do <Action <IHerculesEventBuilder> >(x => x(builder)));

            log
            .WithProperty(WellKnownProperties.OperationContext, new OperationContextValue(new[] { "op1", "op2" }))
            .Info("Hello!");

            var @event = builder.BuildEvent();

            var vector = @event.Tags[LogEventTagNames.Properties]?.AsContainer[WellKnownProperties.OperationContext]?.AsVector;

            vector?.AsStringList.Should().Equal("op1", "op2");
        }