In some scenarios it is necessary to compare the structure of json documents in your automated tests. for example you might want to make sure that the json representation of what is in your storage, mirrors whats returned by to what is returned from your apis.
its also possible that these two different sources have some fields missing or that they serialize the data in different ways, for example a json string might represent numbers as single digit unless explicitly made to use decimals.
the following c# object allows for comparing two expando objects, the idea is to load a json string representation as an expando object using any json parser that you like, and be able to compare it to another. using expando objects makes this implementation agnostic to different json serializers.
using System;
using System.Collections;
using System.Collections.Generic;