Exemple #1
0
        internal void Clone_Model_View(CloneViewType cloneViewType, Platform platform)
        {
            var cloneViewId = $"test_{cloneViewType}";

            var application = DefaultCloneModelViewModule(info => {
                var cloneModelViewAttribute = new CloneModelViewAttribute(cloneViewType, cloneViewId);
                info.FindTypeInfo(typeof(CMV)).AddAttribute(cloneModelViewAttribute);
            }, platform).Application;
            var modelView = application.Model.Views[cloneViewId];

            modelView.ShouldNotBeNull();
            modelView.GetType().Name.ShouldBe($"Model{cloneViewType.ToString().Replace("Lookup", "")}");
            modelView.Id.ShouldBe(cloneViewId);
        }
        public void Clone_Model_View(CloneViewType cloneViewType)
        {
            var cloneViewId = $"{nameof(Clone_Model_View)}_{cloneViewType}";

            var application = DefaultCloneModelViewModule(info => {
                var cloneModelViewAttribute = new CloneModelViewAttribute(cloneViewType, cloneViewId);
                info.FindTypeInfo(typeof(CMV)).AddAttribute(cloneModelViewAttribute);
            }).Application;

            ((bool)application.GetPropertyValue("EnableModelCache")).ShouldBe(false);

            var modelView = application.Model.Views[cloneViewId];

            modelView.ShouldNotBeNull();
            modelView.GetType().Name.ShouldBe($"Model{cloneViewType.ToString().Replace("Lookup", "")}");
            modelView.Id.ShouldBe(cloneViewId);
            application.Dispose();
        }