public void TryGetLanguageVersion_FailsIfNoLanguageVersion()
        {
            // Arrange
            var projectProperties = new MSBuildPropertyGroup();

            // Act
            var result = DefaultRazorProjectHost.TryGetLanguageVersion(projectProperties, out var languageVersion);

            // Assert
            Assert.False(result);
            Assert.Null(languageVersion);
        }
        public void TryGetLanguageVersion_SucceedsWithValidLanguageVersion()
        {
            // Arrange
            var projectProperties = new MSBuildPropertyGroup();

            projectProperties.SetValue("RazorLangVersion", "1.0");

            // Act
            var result = DefaultRazorProjectHost.TryGetLanguageVersion(projectProperties, out var languageVersion);

            // Assert
            Assert.True(result);
            Assert.Same(RazorLanguageVersion.Version_1_0, languageVersion);
        }
        public void TryGetLanguageVersion_FailsIfEmptyLanguageVersion()
        {
            // Arrange
            var projectProperties = new MSBuildPropertyGroup();

            projectProperties.SetValue("RazorLangVersion", string.Empty);

            // Act
            var result = DefaultRazorProjectHost.TryGetLanguageVersion(projectProperties, out var languageVersion);

            // Assert
            Assert.False(result);
            Assert.Null(languageVersion);
        }
        public void TryGetLanguageVersion_SucceedsWithUnknownLanguageVersion_DefaultsToLatest()
        {
            // Arrange
            var projectProperties = new MSBuildPropertyGroup();

            projectProperties.SetValue("RazorLangVersion", "13.37");

            // Act
            var result = DefaultRazorProjectHost.TryGetLanguageVersion(projectProperties, out var languageVersion);

            // Assert
            Assert.True(result);
            Assert.Same(RazorLanguageVersion.Latest, languageVersion);
        }