public virtual void TestAgainstMainVersionConstant() { LuceneVersion[] values = Enum.GetValues(typeof(LuceneVersion)).Cast <LuceneVersion>().ToArray(); Assert.IsTrue(values.Length >= 2); string mainVersionWithoutAlphaBeta = Constants.MainVersionWithoutAlphaBeta(); LuceneVersion mainVersionParsed = LuceneVersionExtensions.ParseLeniently(mainVersionWithoutAlphaBeta); Assert.AreEqual(mainVersionParsed, values[values.Length - 2], "Constant one before last must be the same as the parsed LUCENE_MAIN_VERSION (without alpha/beta) constant: " + mainVersionWithoutAlphaBeta); }
public virtual void TestParseLeniently() { Assert.AreEqual(LuceneVersion.LUCENE_40, LuceneVersionExtensions.ParseLeniently("4.0")); Assert.AreEqual(LuceneVersion.LUCENE_40, LuceneVersionExtensions.ParseLeniently("LUCENE_40")); Assert.AreEqual(LuceneVersion.LUCENE_CURRENT, LuceneVersionExtensions.ParseLeniently("LUCENE_CURRENT")); }