public void AsDictionary_WithSequenceValue_ReturnsNull() { var logEventProperty = new LogEventProperty("test", new SequenceValue(Array.Empty <LogEventPropertyValue>())); IDictionary outputValue = logEventProperty.AsDictionary(); Assert.That(outputValue, Is.EqualTo(null)); }
public void AsDictionary_WithDictionaryValue_ReturnsDictionaryWithCorrectValues() { var logEventProperty = new LogEventProperty("test", new DictionaryValue(new[] { new KeyValuePair <ScalarValue, LogEventPropertyValue>(new ScalarValue("item1"), new ScalarValue("item1_value")), new KeyValuePair <ScalarValue, LogEventPropertyValue>(new ScalarValue("item2"), new ScalarValue("item2_value")) })); IDictionary outputValue = logEventProperty.AsDictionary(); Assert.That(outputValue, Contains.Key("item1").WithValue("item1_value")); Assert.That(outputValue, Contains.Key("item2").WithValue("item2_value")); }