/// <summary>
        /// Responsible for deserializing the JSON that was built.
        /// Will ensure that the JSON is well-formed
        /// </summary>
        public static Dictionary <string, JsonElement> SerializeOutputJSON(InputOutputPairing pairing)
        {
            var resultJSON = pairing.FormattedOutput;
            var resultDic  = JsonSerializer.Deserialize <Dictionary <string, JsonElement> >(resultJSON);

            return(resultDic);
        }
Пример #2
0
        public void Emit(LogEvent logEvent)
        {
            var ioPairing = new InputOutputPairing(logEvent);

            InputsAndOutputs.Add(ioPairing);

            using (var writer = new StringWriter())
            {
                _formatter.Format(logEvent, writer);
                ioPairing.FormattedOutput = writer.ToString();
            }
        }
Пример #3
0
        /// <summary>
        /// Responsible for deserializing the JSON that was built.
        /// Will ensure that the JSON is well-formed
        /// </summary>
        public static Dictionary <string, JsonElement> DeserializeOutputJSON(InputOutputPairing pairing)
        {
            var resultJSON = pairing.FormattedOutput;

            return(TestHelpers.DeserializeOutputJSON(resultJSON));
        }