Пример #1
0
    public void UICultureIsChangedWithinTest(string uiCulture)
    {
        var originalUICulture = Thread.CurrentThread.CurrentUICulture;
        var attr = new UseCultureAttribute("ru-RU", uiCulture);

        attr.Before(null);

        Assert.Equal(attr.UICulture, Thread.CurrentThread.CurrentUICulture);

        attr.After(null);

        Assert.Equal(originalUICulture, Thread.CurrentThread.CurrentUICulture);
    }
    public void CultureIsChangedWithinTest(string culture)
    {
        var originalCulture = Thread.CurrentThread.CurrentCulture;
        var attr = new UseCultureAttribute(culture);

        attr.Before(null);

        Assert.Equal(attr.Culture, Thread.CurrentThread.CurrentCulture);

        attr.After(null);

        Assert.Equal(originalCulture, Thread.CurrentThread.CurrentCulture);
    }
Пример #3
0
    public void CultureIsChangedWithinTest(string culture)
    {
        var originalCulture = Thread.CurrentThread.CurrentCulture;
        var attr            = new UseCultureAttribute(culture);

        attr.Before(null);

        Assert.Equal(attr.Culture, Thread.CurrentThread.CurrentCulture);

        attr.After(null);

        Assert.Equal(originalCulture, Thread.CurrentThread.CurrentCulture);
    }
        public void RefreshCachedCultureRelatedInformationWithinTest(string culture)
        {
            var originalCulture = Thread.CurrentThread.CurrentCulture;
            var attr            = new UseCultureAttribute(culture);

            attr.Before(null !);

            _ = new RegionInfo(Thread.CurrentThread.CurrentCulture.LCID);

            Assert.Equal(attr.Culture, Thread.CurrentThread.CurrentCulture);

            attr.After(null !);

            Assert.Equal(originalCulture, Thread.CurrentThread.CurrentCulture);
        }
Пример #5
0
        public void RefreshCachedCultureRelatedInformationWithinTest(string culture)
        {
            var originalCulture = Thread.CurrentThread.CurrentCulture;
            var attr            = new UseCultureAttribute(culture);

            attr.Before(null);

            var ci = new CultureInfo(Thread.CurrentThread.CurrentCulture.LCID);

            Assert.Equal(attr.Culture, Thread.CurrentThread.CurrentCulture);
            Assert.Equal(ci.TwoLetterISOLanguageName, CultureInfo.CurrentUICulture.TwoLetterISOLanguageName);

            attr.After(null);

            Assert.Equal(originalCulture, Thread.CurrentThread.CurrentCulture);
        }
Пример #6
0
    public void CreatingWithCultureAndUICultureSetsCorrectUICulturePropery(string uiCulture)
    {
        var attr = new UseCultureAttribute("el-GR", uiCulture);

        Assert.Equal(uiCulture, attr.UICulture.Name);
    }
Пример #7
0
    public void CreatingWithCultureSetsSameUICulture(string culture)
    {
        var attr = new UseCultureAttribute(culture);

        Assert.Equal(culture, attr.UICulture.Name);
    }
Пример #8
0
    public void CreatingWithCultureAndUICultureSetsCorrectCulturePropery(string culture)
    {
        var attr = new UseCultureAttribute(culture, "fr");

        Assert.Equal(culture, attr.Culture.Name);
    }
    public void UICultureIsChangedWithinTest(string uiCulture)
    {
        var originalUICulture = Thread.CurrentThread.CurrentUICulture;
        var attr = new UseCultureAttribute("ru-RU", uiCulture);

        attr.Before(null);

        Assert.Equal(attr.UICulture, Thread.CurrentThread.CurrentUICulture);

        attr.After(null);

        Assert.Equal(originalUICulture, Thread.CurrentThread.CurrentUICulture);
    }
    public void CreatingWithCultureAndUICultureSetsCorrectUICulturePropery(string uiCulture)
    {
        var attr = new UseCultureAttribute("el-GR", uiCulture);

        Assert.Equal(uiCulture, attr.UICulture.Name);
    }
    public void CreatingWithCultureSetsSameUICulture(string culture)
    {
        var attr = new UseCultureAttribute(culture);

        Assert.Equal(culture, attr.UICulture.Name);
    }
    public void CreatingWithCultureAndUICultureSetsCorrectCulturePropery(string culture)
    {
        var attr = new UseCultureAttribute(culture, "fr");

        Assert.Equal(culture, attr.Culture.Name);
    }