Exemplo n.º 1
0
        public bool Match(HttpContext httpContext, IRouter route, string routeKey, RouteValueDictionary values, RouteDirection routeDirection)
        {
            if (!values.ContainsKey(Api.ROUTING_CULTURE_CONSTRAINT))
            {
                return(false);
            }

            var cultureCode = values[Api.ROUTING_CULTURE_CONSTRAINT].ToString();

            return(LocalizationUtils.CultureExists(cultureCode));
        }
Exemplo n.º 2
0
 public void CultureExists_When_CultureCode_Exists_Returns_True()
 {
     LocalizationUtils.CultureExists(new CultureStub().Code).ShouldBeTrue();
 }
Exemplo n.º 3
0
 public void CultureExists_When_CultureCode_DoesNotExist_Returns_False()
 {
     LocalizationUtils.CultureExists("404").ShouldBeFalse();
 }