コード例 #1
0
        /// <summary>
        /// Gets the language.
        /// </summary>
        /// <param name="fileContent">Content of the file.</param>
        /// <returns>
        /// An object that supports the <see cref="ILanguageInfo" /> abstraction.
        /// </returns>
        public ILanguageInfo TryParse(string fileContent)
        {
            var name      = this.specifiedLanguage.Name;
            var langMatch = LanguagePattern.Match(fileContent);

            if (langMatch.Success)
            {
                name = langMatch.Groups["lang"].Value;
            }

            return(SupportedLanguages.GetSupportedLanguage(name));
        }
コード例 #2
0
 public void ShouldNotSupportGerman()
 {
     Should.Throw <Gherkin.GherkinException>(() => SupportedLanguages.GetSupportedLanguage("de"));
 }
コード例 #3
0
        public void ShouldSupportFrench()
        {
            var item = SupportedLanguages.GetSupportedLanguage("fr");

            item.Should().NotBeNull();
        }
コード例 #4
0
        public void ShouldSupportEnglishUk()
        {
            var item = SupportedLanguages.GetSupportedLanguage("en-UK");

            item.Should().NotBeNull();
        }
コード例 #5
0
 /// <summary>
 /// Gets the language information for the specified code.
 /// </summary>
 /// <param name="code">The code.</param>
 /// <returns>An object that supports the <see cref="ILanguageInfo"/> abstraction.</returns>
 public static ILanguageInfo For(string code)
 {
     return(SupportedLanguages.GetSupportedLanguage(code));
 }