Update razor lang version to 7.0

This commit is contained in:
jacalvar 2022-06-10 13:34:59 +02:00
Родитель 4cf2469411
Коммит da15aa0bea
2 изменённых файлов: 23 добавлений и 2 удалений

Просмотреть файл

@ -26,7 +26,9 @@ public sealed class RazorLanguageVersion : IEquatable<RazorLanguageVersion>, ICo
public static readonly RazorLanguageVersion Version_6_0 = new RazorLanguageVersion(6, 0);
public static readonly RazorLanguageVersion Latest = Version_6_0;
public static readonly RazorLanguageVersion Version_7_0 = new RazorLanguageVersion(7, 0);
public static readonly RazorLanguageVersion Latest = Version_7_0;
public static readonly RazorLanguageVersion Experimental = new RazorLanguageVersion(1337, 1337);
@ -47,6 +49,11 @@ public sealed class RazorLanguageVersion : IEquatable<RazorLanguageVersion>, ICo
version = Experimental;
return true;
}
else if (languageVersion == "7.0")
{
version = Version_7_0;
return true;
}
else if (languageVersion == "6.0")
{
version = Version_6_0;

Просмотреть файл

@ -123,6 +123,20 @@ public class RazorLanguageVersionTest
Assert.Same(RazorLanguageVersion.Version_6_0, version);
}
[Fact]
public void TryParse70()
{
// Arrange
var value = "7.0";
// Act
var result = RazorLanguageVersion.TryParse(value, out var version);
// Assert
Assert.True(result);
Assert.Same(RazorLanguageVersion.Version_7_0, version);
}
[Fact]
public void TryParseLatest()
{
@ -134,7 +148,7 @@ public class RazorLanguageVersionTest
// Assert
Assert.True(result);
Assert.Same(RazorLanguageVersion.Version_6_0, version);
Assert.Same(RazorLanguageVersion.Version_7_0, version);
}
[Fact]