public void Inherit_And_Modify_A_BaseView(ViewType viewType, bool attribute)
        {
            ModelViewInheritanceUpdater.Disabled = true;
            var application = new XafApplicationMock().Object;
            var modelViewIneritanceModule = CreateModelViewIneritanceModule(viewType, attribute, application);
            var baseBoTypes = new[] { typeof(ABaseMvi), typeof(TagMvi) };
            var boTypes     = new[] { typeof(AMvi), typeof(FileMvi) };

            modelViewIneritanceModule.AdditionalExportedTypes.AddRange(baseBoTypes.Concat(boTypes));
            application.SetupDefaults(modelViewIneritanceModule);
            var inheritAndModifyBaseView = new InheritAndModifyBaseView(application, viewType, attribute);
            var models = inheritAndModifyBaseView.GetModels().ToArray();

            ModelViewInheritanceUpdater.Disabled = false;

            application = new XafApplicationMock().Object;
            modelViewIneritanceModule = CreateModelViewIneritanceModule(viewType, attribute, application);
            var testModule1 = new TestModule1 {
                DiffsStore = new StringModelStore(models[0])
            };

            testModule1.AdditionalExportedTypes.AddRange(baseBoTypes);
            var testModule2 = new TestModule2 {
                DiffsStore = new StringModelStore(models[1])
            };

            testModule2.AdditionalExportedTypes.AddRange(boTypes);

            application.SetupDefaults(modelViewIneritanceModule, testModule1, testModule2,
                                      new TestModule3 {
                DiffsStore = new StringModelStore(models[2])
            });

            inheritAndModifyBaseView.Verify(application.Model);
        }
        public void Inherit_And_Modify_A_BaseView(ViewType viewType, bool attribute)
        {
            if (attribute && viewType == ViewType.DetailView)
            {
                return;
            }
            ModelViewInheritanceUpdater.Disabled = true;
            var application = new XafApplicationMock().Object;
            var modelViewIneritanceModule = CreateModelViewIneritanceModule(viewType, attribute, application);

            application.SetupDefaults(modelViewIneritanceModule);
            var inheritAndModifyBaseView = new InheritAndModifyBaseView(application, viewType, attribute);
            var models = inheritAndModifyBaseView.ToArray();

            ModelViewInheritanceUpdater.Disabled = false;

            application = new XafApplicationMock().Object;
            modelViewIneritanceModule = CreateModelViewIneritanceModule(viewType, attribute, application);
            application.SetupDefaults(modelViewIneritanceModule,
                                      new TestModule1 {
                DiffsStore = new StringModelStore(models[0])
            },
                                      new TestModule2 {
                DiffsStore = new StringModelStore(models[1])
            },
                                      new TestModule3 {
                DiffsStore = new StringModelStore(models[2])
            });

            inheritAndModifyBaseView.Verify(application.Model);
        }
Example #3
0
        private CloneMemberValueModule DefaultCloneMemberValueModule()
        {
            var application            = new XafApplicationMock().Object;
            var cloneMemberValueModule = new CloneMemberValueModule();

            cloneMemberValueModule.AdditionalExportedTypes.AddRange(new[] { typeof(ACmv), typeof(BCmv) });
            application.SetupDefaults(cloneMemberValueModule);
            return(cloneMemberValueModule);
        }
Example #4
0
        private ViewEditModeModule DefaultViewEditModeModule()
        {
            var application        = new XafApplicationMock().Object;
            var viewEditModeModule = new ViewEditModeModule();

            viewEditModeModule.AdditionalExportedTypes.AddRange(new[] { typeof(VEM) });
            application.SetupDefaults(viewEditModeModule);
            return(viewEditModeModule);
        }
        private SupressConfirmationModule DefaultAutoCommitModule()
        {
            var application = new XafApplicationMock().Object;

            application.Title = "AutoCommitModule";
            var supressConfirmationModule = new SupressConfirmationModule();

            supressConfirmationModule.AdditionalExportedTypes.AddRange(new[] { typeof(SC) });
            application.SetupDefaults(supressConfirmationModule);

            var modelClassSupressConfirmation = (IModelClassSupressConfirmation)application.Model.BOModel.GetClass(typeof(SC));

            modelClassSupressConfirmation.SupressConfirmation = true;
            return(supressConfirmationModule);
        }
Example #6
0
        private AutoCommitModule DefaultAutoCommitModule()
        {
            var application = new XafApplicationMock().Object;

            application.Title = "AutoCommitModule";
            var autoCommitModule = new AutoCommitModule();

            autoCommitModule.AdditionalExportedTypes.AddRange(new[] { typeof(AC) });
            application.SetupDefaults(autoCommitModule);

            var modelClassAutoCommit = (IModelClassAutoCommit)application.Model.BOModel.GetClass(typeof(AC));

            modelClassAutoCommit.AutoCommit = true;
            return(autoCommitModule);
        }