Пример #1
0
        public MainForm()
        {
            InitializeComponent();

            m_context = new Context(this);
            m_context.SetState(Context.State.Init);

            //policies summary panel setup
            m_policiesSummaryPanel = new PoliciesSummaryPanelControl(m_context);

            //policy panel setup
            m_policyPanel = new PolicyDetailsPanelControl(m_context);

            //conditions panel setup
            m_conditionsPanel = new ConditionsPanelControl(m_context);

            //action panel setup
            m_actionPanel = new ActionPanelControl(m_context);

            //Controller for policy tree view
            m_treeViewController = new TreeViewControllerPolicyOriented(m_context);
            m_treeViewController.View = this.TreeView;

            this.WindowState = FormWindowState.Maximized;

        }
        public void TestSavePolicySetEnabled()
        {
            PoliciesSummaryPanelControl policiesSummaryPanelControl = new PoliciesSummaryPanelControl();
            
            //test is disabled by default
            Control saveButton = policiesSummaryPanelControl.Controls["saveButton"];
            Assert.IsFalse(saveButton.Enabled, "Incorrect default value");

            //test changing the value
            policiesSummaryPanelControl.SavePolicySetEnabled = true;
            Assert.IsTrue(saveButton.Enabled, "Incorrect value after attempting to set to TRUE");
            Assert.IsTrue(policiesSummaryPanelControl.SavePolicySetEnabled, "Incorrect value returned by get");
            policiesSummaryPanelControl.SavePolicySetEnabled = false;
            Assert.IsFalse(saveButton.Enabled, "Incorrect value after attempting to set to FALSE");
            Assert.IsFalse(policiesSummaryPanelControl.SavePolicySetEnabled, "Incorrect value returned by get");
        }