/// <summary>check very basic hashCode and equals </summary> public static void CheckHashEquals(Query q) { Query q2 = (Query)q.Clone(); CheckEqual(q, q2); Query q3 = (Query)q.Clone(); q3.Boost = 7.21792348f; CheckUnequal(q, q3); // test that a class check is done so that no exception is thrown // in the implementation of equals() Query whacky = new AnonymousClassQuery(); whacky.Boost = q.Boost; CheckUnequal(q, whacky); }
/// <summary>check very basic hashCode and equals </summary> public static void CheckHashEquals(Query q) { Query q2 = (Query) q.Clone(); CheckEqual(q, q2); Query q3 = (Query) q.Clone(); q3.SetBoost(7.21792348f); CheckUnequal(q, q3); // test that a class check is done so that no exception is thrown // in the implementation of equals() Query whacky = new AnonymousClassQuery(); whacky.SetBoost(q.GetBoost()); CheckUnequal(q, whacky); }