public static IEnumerable <SelectorModel> GetUntranslatedSelectorsFor(this ActionModel originalActionModel, ILocalizer localizer, string culture) { ActionModel localizedActionModel = originalActionModel.GetLocalizedModelFor(localizer, culture); return(originalActionModel.Selectors.Skip(localizedActionModel.Selectors.Count)); }
public void GetLocalizedModelForLocalizedActionThrowsException() { ApplicationModel applicationModel = TestApplicationModel.Instance; ControllerModel controller = applicationModel.Controller1(); ActionModel action = controller.Actions.First(); ControllerModel translatedController = controller.CreateLocalizedControllerModel(GetLocalizedRouteMarker(), ModelExtensionTest.Culture); ActionModel translatedAction = translatedController.Actions.First(); applicationModel.Controllers.Add(translatedController); ActionModel translatedAction2 = translatedAction.GetLocalizedModelFor(GetLocalizedRouteMarker(), ModelExtensionTest.Culture); }
public void GetLocalizedModelForOriginalActionReturnsLocalizedAction() { ApplicationModel applicationModel = TestApplicationModel.Instance; ControllerModel controller = applicationModel.Controller1(); ActionModel action = controller.Actions.First(); ControllerModel translatedController = controller.CreateLocalizedControllerModel(GetLocalizedRouteMarker(), ModelExtensionTest.Culture); ActionModel translatedAction = translatedController.Actions.First(); applicationModel.Controllers.Add(translatedController); ActionModel translatedAction2 = action.GetLocalizedModelFor(GetLocalizedRouteMarker(), ModelExtensionTest.Culture); Assert.AreSame(translatedAction, translatedAction2); }