public void Print_ShouldPrettifyJsonContent()
        {
            var json       = @"{""Container"":{""Type"":""NServiceBus.CommonObjectBuilder""}}";
            var prettified = JsonPrettyPrinter.Print(json);

            Approver.Verify(prettified);
        }
        public void Print_ShouldPrettifyCollections()
        {
            var json       = @"{""Dependencies"":[""RootFeature"",""DelayedDeliveryFeature""],""StartupTasks"":[]}";
            var prettified = JsonPrettyPrinter.Print(json);

            Approver.Verify(prettified);
        }
        public void Print_ShouldPrettifyEscapedStrings()
        {
            var json       = @"{""PrerequisiteStatus"": {""IsSatisfied"": false, ""Reasons"": [""Because some \""escaped\"" json content""]}}";
            var prettified = JsonPrettyPrinter.Print(json);

            Approver.Verify(prettified);
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            dynamic person = new ExpandoObject();

            person.FirstName  = "Terry";
            person.LastName   = "Tate";
            person.Occupation = "Office Linebacker";

            IPrettyPrinter pp = new JsonPrettyPrinter();

            pp.Print(person, "Person");
        }