예제 #1
0
 public void CanParseVersion()
 {
     Assert.True(Version.TryParse("1.2.3", out var version));
     Assert.Equal(new Version(1, 2, 3), version);
 }
예제 #2
0
 public void DoesNotParseInvalidVersions(string str)
 {
     Assert.False(Version.TryParse(str, out _));
 }
예제 #3
0
 public void CanParsePrerealeaseVersion()
 {
     Assert.True(Version.TryParse("1.2.0-alpha.3", out var version));
     Assert.Equal(new Version(1, 2, 3, "alpha"), version);
 }
예제 #4
0
 public void CanParsePrerealeaseVersionCOntaningExtraDashesDotsAndNumbers()
 {
     Assert.True(Version.TryParse("1.2.0-alpha-1.17.3", out var version));
     Assert.Equal(new Version(1, 2, 3, "alpha-1.17"), version);
 }
예제 #5
0
 public void CanParseVersionWithLongBuild()
 {
     Assert.True(Version.TryParse($"1.2.{long.MaxValue}", out var version));
     Assert.Equal(new Version(1, 2, long.MaxValue), version);
 }