示例#1
0
            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")));
            }
示例#2
0
            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")));
            }
示例#3
0
            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")));
            }
示例#4
0
            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")));
            }