public static void TestPlaneToJson() { //The one thing we want to check // -a valid plane object converts to a valid JSON object //We could do some tests here as far as malformed/invalid objects, but that ObjectTests should probably be ensuring we are getting a proper object //make some planes Plane plane1 = new Plane("abcd", new PlaneAttributes("abcd", 2, 45, 20, 100, 19000)); //valid plane object Plane plane2 = new Plane("DEF328", new PlaneAttributes("483CBA50", 1, 35, 15, 50, 12000)); //valid plane object //Give them a current position - AddPosition(GPSData data) GPSData gps1 = new GPSData (-90, 90, 20000, 232050); GPSData gps2 = new GPSData (-45, 45, 15000, 190000); plane1.AddPosition(gps1); plane2.AddPosition(gps2); //convert the objects to JSON string jsonPlane1 = plane1.ToJson(); string jsonPlane2 = plane2.ToJson(); JsonObject correctJSONObject1 = (JsonObject)Json.Parse(createCorrectDataSet()); JsonObject correctJSONObject2 = (JsonObject)Json.Parse(createCorrectDataSet2()); //test them jsonPlane1.ShouldBe(correctJSONObject1.PrettyPrint()); jsonPlane2.ShouldBe(correctJSONObject2.PrettyPrint()); }