Esempio n. 1
0
        protected virtual void Apply <TDestination>(LogCastDocument document, TDestination value)
        {
            var existingValue = document.GetProperty <object>(Key);

            if (existingValue is Dictionary <string, object> childDictionary)
            {
                childDictionary[Property.DefaultChildName] = value;
            }
            else
            {
                document.AddProperty(Name, value, SuppressDefaults);
            }
        }
Esempio n. 2
0
        protected override void Apply <TDestination>(LogCastDocument document, TDestination value)
        {
            var existingValue = document.GetProperty <object>(ParentName);

            if (existingValue is Dictionary <string, object> childDictionary)
            {
                existingValue = null;
            }
            else
            {
                childDictionary = new Dictionary <string, object>();
                document.AddProperty(ParentName, childDictionary);
            }

            if (existingValue != null)
            {
                childDictionary[Property.DefaultChildName] = existingValue;
            }

            childDictionary[Name] = value;
        }
Esempio n. 3
0
 public void then_higher_log_severity_is_picked_out_of_merge()
 {
     _lastLog.GetProperty <string>(Property.LogLevel)
     .Should().Be("Error",
                  "Merge should have replaced accumulated value of the second log call with higher severity");
 }
Esempio n. 4
0
 public void then_object_is_what_was_set()
 {
     _cut.GetProperty <object>("key").Should().NotBeNull().And.Be(10);
 }