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