public void checkElementSeperatorCharacter()
        {
            JsonValueWriter writer = new JsonValueWriter();

            writer.InsertElementSeperator();

            // then
            Assert.That(writer.ToString(), Is.EqualTo(","));
        }
Beispiel #2
0
        internal override void WriteJSONString(JsonValueWriter writer)
        {
            writer.OpenArray();
            int writtenElements = 0;

            foreach (JsonValue value in jsonValues)
            {
                if (writtenElements++ > 0)
                {
                    writer.InsertElementSeperator();
                }

                value.WriteJSONString(writer);
            }

            writer.CloseArray();
        }
        internal override void WriteJSONString(JsonValueWriter writer)
        {
            writer.OpenObject();

            int writtenElements = 0;

            foreach (KeyValuePair <string, JsonValue> entry in jsonObjectDictionary)
            {
                if (entry.Key != null)
                {
                    if (writtenElements++ > 0)
                    {
                        writer.InsertElementSeperator();
                    }

                    writer.InsertKey(entry.Key);
                    writer.InsertKeyValueSeperator();
                    entry.Value.WriteJSONString(writer);
                }
            }

            writer.CloseObject();
        }