public void Cachability_Test()
{
TermsFilter a = new TermsFilter();
a.AddTerm(new Term("field1", "a"));
a.AddTerm(new Term("field1", "b"));
// original test used placing filters in a HashSet to
// determine equality, where the FilterManager uses
// the hash code of the filters as the key, so
// it makes more sense to just test the equality of the
// hash codes.
TermsFilter b = new TermsFilter();
b.AddTerm(new Term("field1", "a"));
b.AddTerm(new Term("field1", "b"));
Assert.AreEqual(a.GetHashCode(), b.GetHashCode(), "Hashes do not match");
b.AddTerm(new Term("field1", "a")); //duplicate term
Assert.AreEqual(a.GetHashCode(), b.GetHashCode(), "Hashes do not match");
b.AddTerm(new Term("field1", "c"));
Assert.AreNotEqual(a.GetHashCode(), b.GetHashCode(), "Hashes match");
}