Esempio n. 1
0
        public void Setup()
        {
            string jsonString = JsonStrings.ResourceManager.GetString(TestCase.ToString());

            _dataUtf8 = DocumentHelpers.RemoveFormatting(jsonString);

            _document = JsonDocument.Parse(_dataUtf8);
            _element  = _document.RootElement;
        }
Esempio n. 2
0
        public void Setup()
        {
            string jsonString = JsonStrings.ResourceManager.GetString(TestCase.ToString());

            // Remove all formatting/indentation
            if (!IsDataIndented)
            {
                _dataUtf8 = DocumentHelpers.RemoveFormatting(jsonString);
            }
            else
            {
                _dataUtf8 = Encoding.UTF8.GetBytes(jsonString);
            }
        }
Esempio n. 3
0
        public void Setup()
        {
            string jsonString = JsonStrings.ResourceManager.GetString(TestCase.ToString());

            if (!IsDataIndented)
            {
                _dataUtf8 = DocumentHelpers.RemoveFormatting(jsonString);
            }
            else
            {
                _dataUtf8 = Encoding.UTF8.GetBytes(jsonString);
            }

            var abw = new ArrayBufferWriter <byte>();

            _writer = new Utf8JsonWriter(abw, new JsonWriterOptions {
                Indented = IsDataIndented
            });
        }