ParseLeniently() public static method

public static ParseLeniently ( string version ) : Lucene.Net.Util.Version
version string
return Lucene.Net.Util.Version
示例#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);
        }
示例#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"));
 }