protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         _presenter.OnViewInitialized();
     }
     _presenter.OnViewLoaded();
 }
        public void SecondRowModuleNameIsEmpty()
        {
            MockAdminController controller = new MockAdminController();
            ModulePermissionSet[] modulePermissionSets = controller.ModulePermissionSets = PermissionHelper.GetNewModulePermissionSet();
            ViewRolePermissionViewPresenter presenter = new ViewRolePermissionViewPresenter(controller);
            MockView view = new MockView();
            presenter.View = view;

            presenter.OnViewLoaded();

            Assert.IsTrue(view.RolePermissions[0].Rows[1][0] is DBNull);
        }
        public void SecondRowModuleNameIsEmpty()
        {
            MockAdminController controller = new MockAdminController();

            ModulePermissionSet[]           modulePermissionSets = controller.ModulePermissionSets = PermissionHelper.GetNewModulePermissionSet();
            ViewRolePermissionViewPresenter presenter            = new ViewRolePermissionViewPresenter(controller);
            MockView view = new MockView();

            presenter.View = view;

            presenter.OnViewLoaded();

            Assert.IsTrue(view.RolePermissions[0].Rows[1][0] is DBNull);
        }
        public void OnViewLoadedCallsControllerGetModulePermissionAndSetsRolePermissionsInView()
        {
            MockAdminController controller = new MockAdminController();
            ModulePermissionSet[] modulePermissionSets = controller.ModulePermissionSets = PermissionHelper.GetNewModulePermissionSet();
            ViewRolePermissionViewPresenter presenter = new ViewRolePermissionViewPresenter(controller);
            MockView view = new MockView();
            presenter.View = view;

            presenter.OnViewLoaded();

            Assert.IsTrue(controller.GetModulePermissionCalled);
            Assert.IsTrue(view.RolePermissionsSet);
            Assert.IsTrue(PermissionHelper.AreEqual(modulePermissionSets, view.RolePermissions));
        }
        public void OnViewLoadedCallsControllerGetModulePermissionAndSetsRolePermissionsInView()
        {
            MockAdminController controller = new MockAdminController();

            ModulePermissionSet[]           modulePermissionSets = controller.ModulePermissionSets = PermissionHelper.GetNewModulePermissionSet();
            ViewRolePermissionViewPresenter presenter            = new ViewRolePermissionViewPresenter(controller);
            MockView view = new MockView();

            presenter.View = view;

            presenter.OnViewLoaded();

            Assert.IsTrue(controller.GetModulePermissionCalled);
            Assert.IsTrue(view.RolePermissionsSet);
            Assert.IsTrue(PermissionHelper.AreEqual(modulePermissionSets, view.RolePermissions));
        }