Exemple #1
0
        public virtual void TestAgainstMainVersionConstant()
        {
            LuceneVersion[] values = Enum.GetValues(typeof(LuceneVersion)).Cast <LuceneVersion>().ToArray();
            Assert.IsTrue(values.Length >= 2);
            string        mainVersionWithoutAlphaBeta = Constants.MainVersionWithoutAlphaBeta();
            LuceneVersion mainVersionParsed           = LuceneVersionHelpers.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);
        }
Exemple #2
0
 public virtual void TestParseLeniently()
 {
     Assert.AreEqual(LuceneVersion.LUCENE_40, LuceneVersionHelpers.ParseLeniently("4.0"));
     Assert.AreEqual(LuceneVersion.LUCENE_40, LuceneVersionHelpers.ParseLeniently("LUCENE_40"));
     Assert.AreEqual(LuceneVersion.LUCENE_CURRENT, LuceneVersionHelpers.ParseLeniently("LUCENE_CURRENT"));
 }