示例#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);
    }
示例#2
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 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);
    }
示例#4
0
    public void RefreshCachedCultureRelatedInformationWithinTest(string culture)
    {
        var originalCulture = Thread.CurrentThread.CurrentCulture;
        var attr            = new UseCultureAttribute(culture);

        attr.Before(null);

        var ri = new RegionInfo(Thread.CurrentThread.CurrentCulture.LCID);

        Assert.Equal(attr.Culture, Thread.CurrentThread.CurrentCulture);
        Assert.Equal(ri.TwoLetterISORegionName, RegionInfo.CurrentRegion.TwoLetterISORegionName);

        attr.After(null);

        Assert.Equal(originalCulture, Thread.CurrentThread.CurrentCulture);
    }
    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);
    }