Exemplo n.º 1
0
        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());
        }
Exemplo n.º 2
0
 public void TestParseMsVersionThrowsWithTooManyNumbers()
 {
     Assert.ThrowsException <FormatException>(() => MSVersion.Parse("1.2.3.4.5"));
 }
Exemplo n.º 3
0
 public void TestParseMsVersionWithMoreThanFourNumbersAndNotStrict()
 {
     Assert.AreEqual("1.2.3.4.5", MSVersion.Parse("1.2.3.4.5", strict: false).ToString());
 }
Exemplo n.º 4
0
 public void TestParseMsVersionThrowsWithTooFewNumbers()
 {
     Assert.ThrowsException <FormatException>(() => MSVersion.Parse("1"));
 }
Exemplo n.º 5
0
 public void TestParseMsVersionWithMoreThanFourNumbersAndStrict()
 {
     Assert.ThrowsException <FormatException>(() => MSVersion.Parse("1.2.3.4.5"));
 }
Exemplo n.º 6
0
 public void TestParseMsVersionWithMajorAndNotStrict()
 {
     Assert.AreEqual("1", MSVersion.Parse("1", strict: false).ToString());
 }
Exemplo n.º 7
0
 public void TestParseMsVersionWithMajorAndStrict()
 {
     Assert.ThrowsException <FormatException>(() => MSVersion.Parse("1"));
 }
Exemplo n.º 8
0
 public void TestParseMsVersionWithMajorMinorBuildRevision()
 {
     Assert.AreEqual(new MSVersion(1, 2, 3, 4), MSVersion.Parse("1.2.3.4"));
 }
Exemplo n.º 9
0
 public void TestParseMsVersionWithMajorMinor()
 {
     Assert.AreEqual(new MSVersion(1, 2), MSVersion.Parse("1.2"));
 }