Пример #1
0
        public void IsCompletelyTranslatedForOriginalActionThrowsException()
        {
            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);

            bool isCompletelyLocalized = action.IsCompletelyTranslated(GetLocalizedRouteMarker());
        }
Пример #2
0
        public void IsCompletelyTranslatedForNotLocalizedActionReturnsFalse()
        {
            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);

            bool isCompletelyLocalized = translatedAction.IsCompletelyTranslated(GetLocalizedRouteMarker());

            Assert.IsFalse(isCompletelyLocalized);
        }
Пример #3
0
        public void IsCompletelyTranslatedForCompletelyLocalizedActionReturnsTrue()
        {
            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);

            foreach (SelectorModel selectorModel in action.Selectors)
            {
                translatedAction.Selectors.Add(new SelectorModel(selectorModel));
            }

            bool isCompletelyLocalized = translatedAction.IsCompletelyTranslated(GetLocalizedRouteMarker());

            Assert.IsTrue(isCompletelyLocalized);
        }