public void CanParseVersion() { Assert.True(Version.TryParse("1.2.3", out var version)); Assert.Equal(new Version(1, 2, 3), version); }
public void DoesNotParseInvalidVersions(string str) { Assert.False(Version.TryParse(str, out _)); }
public void CanParsePrerealeaseVersion() { Assert.True(Version.TryParse("1.2.0-alpha.3", out var version)); Assert.Equal(new Version(1, 2, 3, "alpha"), version); }
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); }
public void CanParseVersionWithLongBuild() { Assert.True(Version.TryParse($"1.2.{long.MaxValue}", out var version)); Assert.Equal(new Version(1, 2, long.MaxValue), version); }