﻿using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;

namespace Nest.Tests.Unit
{
	public static class JsonExtensions
	{
		internal static bool JsonEquals(this string json, string otherjson)
		{
			var nJson = JObject.Parse(json).ToString();
			var nOtherJson = JObject.Parse(otherjson).ToString();
			//Assert.AreEqual(nOtherJson, nJson);
			return nJson == nOtherJson;
		}
	}
}

﻿using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;

namespace Nest.Tests.Unit
{
	public static class JsonExtensions
	{
		internal static bool JsonEquals(this string json, string otherjson)
		{
			var nJson = JObject.Parse(json);
			var nOtherJson = JObject.Parse(otherjson);
			return JToken.DeepEquals(nJson, nOtherJson);
		}
	}
}

Use deep equality rather than string comparison.
Use deep equality rather than string comparison.

This makes the tests a lot less brittle, since they don't
depend on the vagueries of json ordering
