Update razor lang version to 7.0
This commit is contained in:
Родитель
4cf2469411
Коммит
da15aa0bea
|
@ -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]
|
||||
|
|
Загрузка…
Ссылка в новой задаче