public void TestComparison() { MSVersion[] versions = new MSVersion[] { new MSVersion("1.0.0.1"), new MSVersion("1.2"), new MSVersion("1.2.3"), new MSVersion("0.1"), }; CollectionAssert.AreEqual(new MSVersion[] { new MSVersion("0.1"), new MSVersion("1.0.0.1"), new MSVersion("1.2"), new MSVersion("1.2.3"), }, versions.OrderBy(v => v).ToArray()); }
public void TestParseMsVersionThrowsWithTooManyNumbers() { Assert.ThrowsException <FormatException>(() => MSVersion.Parse("1.2.3.4.5")); }
public void TestParseMsVersionWithMoreThanFourNumbersAndNotStrict() { Assert.AreEqual("1.2.3.4.5", MSVersion.Parse("1.2.3.4.5", strict: false).ToString()); }
public void TestParseMsVersionThrowsWithTooFewNumbers() { Assert.ThrowsException <FormatException>(() => MSVersion.Parse("1")); }
public void TestParseMsVersionWithMoreThanFourNumbersAndStrict() { Assert.ThrowsException <FormatException>(() => MSVersion.Parse("1.2.3.4.5")); }
public void TestParseMsVersionWithMajorAndNotStrict() { Assert.AreEqual("1", MSVersion.Parse("1", strict: false).ToString()); }
public void TestParseMsVersionWithMajorAndStrict() { Assert.ThrowsException <FormatException>(() => MSVersion.Parse("1")); }
public void TestParseMsVersionWithMajorMinorBuildRevision() { Assert.AreEqual(new MSVersion(1, 2, 3, 4), MSVersion.Parse("1.2.3.4")); }
public void TestParseMsVersionWithMajorMinor() { Assert.AreEqual(new MSVersion(1, 2), MSVersion.Parse("1.2")); }