public void GetsTargetCultureIfNoSetting() { // Given TestExecutionContext context = new TestExecutionContext(); // When CultureInfo result = context.GetDateTimeDisplayCulture("fr-FR"); // Then Assert.That(result, Is.EqualTo(CultureInfo.GetCultureInfo("fr-FR"))); }
public void GetsSettingCultureIfSettingMatchesDefault() { // Given TestExecutionContext context = new TestExecutionContext(); context.Settings[Keys.DateTimeDisplayCulture] = CultureInfo.GetCultureInfo("en-US"); // When CultureInfo result = context.GetDateTimeDisplayCulture(); // Then Assert.That(result, Is.EqualTo(CultureInfo.GetCultureInfo("en-US"))); }
public void GetsDefaultCultureIfCurrentCultureDoesNotMatch() { // Given TestExecutionContext context = new TestExecutionContext(); CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo("fr-FR"); // When CultureInfo result = context.GetDateTimeDisplayCulture(); // Then Assert.That(result, Is.EqualTo(CultureInfo.GetCultureInfo("en-GB"))); }
public void GetsSettingCultureIfSettingDoesNotMatchDefaultAndSpecifiedTargetSpecified() { // Given TestExecutionContext context = new TestExecutionContext(); context.Settings[Keys.DateTimeDisplayCulture] = CultureInfo.GetCultureInfo("fr-FR"); // When CultureInfo result = context.GetDateTimeDisplayCulture("fr-LU"); // Then Assert.That(result, Is.EqualTo(CultureInfo.GetCultureInfo("fr-FR"))); }