public RouteTranslator AddTranslation(string url, string culture, LocalizationCollectionRoute route) { RouteTranslator translator = new RouteTranslator(Configuration); return(translator.AddTranslation(url, culture, route)); }
public RouteTranslator AddNeutralTranslationForNamedRoute(string namedRoute) { RouteTranslator translator = new RouteTranslator(Configuration); return(translator.AddNeutralTranslationForNamedRoute(namedRoute)); }
public void StronglyTypedForAndSetFunctions_DefaultRouteTranslator_SavesValues() { // Arrange string controllerName = "MissingAttribute"; string controllerNamespace = "RouteLocalizationMVC.Tests.Core"; string actionName = "Index"; string areaPrefix = "AreaPrefix"; string routePrefix = "RoutePrefix"; string culture = "de"; // Act RouteTranslator<MissingAttributeController> routeTranslator = new RouteTranslator().ForController<MissingAttributeController>().ForAction(x => x.Index()).SetAreaPrefix(areaPrefix) .SetRoutePrefix(routePrefix).ForCulture(culture); // Assert Assert.IsTrue(routeTranslator.Controller == controllerName); Assert.IsTrue(routeTranslator.ControllerNamespace == controllerNamespace); Assert.IsTrue(routeTranslator.Action == actionName); Assert.IsTrue(routeTranslator.AreaPrefix == areaPrefix); Assert.IsTrue(routeTranslator.RoutePrefix == routePrefix); Assert.IsTrue(routeTranslator.Culture == culture); }
public RouteTranslator AddNeutralTranslation(LocalizationCollectionRoute route) { RouteTranslator translator = new RouteTranslator(Configuration); return(translator.AddNeutralTranslation(route)); }
public void ForAndSetFunctions_DefaultRouteTranslator_SavesValues() { // Arrange string controllerName = "Home"; string controllerNamespace = "Namespace"; string actionName = "Index"; string areaPrefix = "AreaPrefix"; string routePrefix = "RoutePrefix"; string culture = "de"; // Act RouteTranslator routeTranslator = new RouteTranslator().ForController(controllerName, controllerNamespace).ForAction(actionName).SetAreaPrefix( areaPrefix).SetRoutePrefix(routePrefix).ForCulture(culture); // Assert Assert.IsTrue(routeTranslator.Controller == controllerName); Assert.IsTrue(routeTranslator.ControllerNamespace == controllerNamespace); Assert.IsTrue(routeTranslator.Action == actionName); Assert.IsTrue(routeTranslator.AreaPrefix == areaPrefix); Assert.IsTrue(routeTranslator.RoutePrefix == routePrefix); Assert.IsTrue(routeTranslator.Culture == culture); }