public void OnFeatureStart_DefersToInnerSynchronousTestRunner() { var featureInfo = new FeatureInfo(CultureInfoHelper.GetCultureInfo("en-us"), "title", "description"); asyncTestRunner.OnFeatureStart(featureInfo); testExecutionEngineStub.Verify(m => m.OnFeatureStart(featureInfo)); }
private static KeywordTranslation LoadTranslation(CultureInfo language) { var assembly = typeof(LanguageHelper).Assembly; var docStream = assembly.GetManifestResourceStream("TechTalk.SpecFlow.Languages.xml"); if (docStream == null) { throw new InvalidOperationException("Language resource not found."); } XDocument languageDoc; using (var reader = new StreamReader(docStream)) { languageDoc = XDocument.Load(reader); } XElement langElm = GetBestFitLanguageElement(languageDoc, language); KeywordTranslation result = new KeywordTranslation(); if (language.IsNeutralCulture) { var defaultSpecificCultureAttr = langElm.Attribute(XName.Get("defaultSpecificCulture", "")); if (defaultSpecificCultureAttr == null) { result.DefaultSpecificCulture = CultureInfoHelper.GetCultureInfo("en-US"); } else { result.DefaultSpecificCulture = CultureInfoHelper.GetCultureInfo(defaultSpecificCultureAttr.Value); } } else { result.DefaultSpecificCulture = language; } foreach (StepDefinitionKeyword keyword in EnumHelper.GetValues(typeof(StepDefinitionKeyword))) { //NOTE: we only load the first translation of each keyword XElement keywordElm = langElm.Element(keyword.ToString()); Debug.Assert(keywordElm != null); result[keyword] = keywordElm.Value; } return(result); }
public RuntimeConfiguration() { ToolLanguage = CultureInfoHelper.GetCultureInfo(ConfigDefaults.FeatureLanguage); BindingCulture = null; RuntimeUnitTestProvider = ConfigDefaults.UnitTestProviderName; DetectAmbiguousMatches = ConfigDefaults.DetectAmbiguousMatches; StopAtFirstError = ConfigDefaults.StopAtFirstError; MissingOrPendingStepsOutcome = ConfigDefaults.MissingOrPendingStepsOutcome; TraceListenerType = typeof(DefaultListener); TraceSuccessfulSteps = ConfigDefaults.TraceSuccessfulSteps; TraceTimings = ConfigDefaults.TraceTimings; MinTracedDuration = TimeSpan.Parse(ConfigDefaults.MinTracedDuration); }
public RuntimeConfiguration() { FeatureLanguage = CultureInfoHelper.GetCultureInfo(ConfigDefaults.FeatureLanguage); ToolLanguage = CultureInfoHelper.GetCultureInfo(ConfigDefaults.FeatureLanguage); BindingCulture = null; RuntimeUnitTestProvider = ConfigDefaults.UnitTestProviderName; DetectAmbiguousMatches = ConfigDefaults.DetectAmbiguousMatches; StopAtFirstError = ConfigDefaults.StopAtFirstError; MissingOrPendingStepsOutcome = ConfigDefaults.MissingOrPendingStepsOutcome; TraceSuccessfulSteps = ConfigDefaults.TraceSuccessfulSteps; TraceTimings = ConfigDefaults.TraceTimings; MinTracedDuration = TimeSpan.Parse(ConfigDefaults.MinTracedDuration); StepDefinitionSkeletonStyle = ConfigDefaults.StepDefinitionSkeletonStyle; AdditionalStepAssemblies = new List <string>(); }
public StepContext(FeatureInfo featureInfo, ScenarioInfo scenarioInfo) { Language = featureInfo == null?CultureInfoHelper.GetCultureInfo(ConfigDefaults.FeatureLanguage) : featureInfo.Language; FeatureTitle = featureInfo == null ? null : featureInfo.Title; ScenarioTitle = scenarioInfo == null ? null : scenarioInfo.Title; var tags = Enumerable.Empty <string>(); if (featureInfo != null && featureInfo.Tags != null) { tags = tags.Concat(featureInfo.Tags); } if (scenarioInfo != null && scenarioInfo.Tags != null) { tags = tags.Concat(scenarioInfo.Tags).Distinct(); } Tags = tags; }
private static CultureInfo GetCultureInfoFromQueryString(string key, CultureInfo defaultValue) { string value; return(QueryString.TryGetValue(key, out value) ? CultureInfoHelper.GetCultureInfo(value) : defaultValue); }