/// <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)); }
public void ShouldNotSupportGerman() { Should.Throw <Gherkin.GherkinException>(() => SupportedLanguages.GetSupportedLanguage("de")); }
public void ShouldSupportFrench() { var item = SupportedLanguages.GetSupportedLanguage("fr"); item.Should().NotBeNull(); }
public void ShouldSupportEnglishUk() { var item = SupportedLanguages.GetSupportedLanguage("en-UK"); item.Should().NotBeNull(); }
/// <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)); }