示例#1
0
        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));
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }