Beispiel #1
0
        public override string ToString()
        {
            JsonValueWriter Writer = new JsonValueWriter();

            WriteJSONString(Writer);
            return(Writer.ToString());
        }
        public void checkKeyFormatting()
        {
            JsonValueWriter writer = new JsonValueWriter();

            writer.InsertKey("Key");

            // then
            Assert.That(writer.ToString(), Is.EqualTo("\"Key\""));
        }
        public void checkStringValueFormatting()
        {
            JsonValueWriter writer = new JsonValueWriter();

            writer.InsertStringValue("false");

            // then
            Assert.That(writer.ToString(), Is.EqualTo("\"false\""));
        }
        public void CheckOpenArrayCharacter()
        {
            JsonValueWriter writer = new JsonValueWriter();

            writer.OpenArray();

            // then
            Assert.That(writer.ToString(), Is.EqualTo("["));
        }
        public void checkKeyValueSeperatorCharacter()
        {
            JsonValueWriter writer = new JsonValueWriter();

            writer.InsertKeyValueSeperator();

            // then
            Assert.That(writer.ToString(), Is.EqualTo(":"));
        }
        public void checkCloseObjectCharacter()
        {
            JsonValueWriter writer = new JsonValueWriter();

            writer.CloseObject();

            // then
            Assert.That(writer.ToString(), Is.EqualTo("}"));
        }