public void TestDeleteAllConditions_Nominal()
        {
            //set up environment
            IPolicy policy1 = PolicyFactory.CreatePolicy("TestPolicy1", m_policySet, PolicyStatus.Active, "None");
            IPolicy policy2 = PolicyFactory.CreatePolicy("TestPolicy2", m_policySet, PolicyStatus.Active, "None");
            IPolicy policy3 = PolicyFactory.CreatePolicy("TestPolicy3", m_policySet, PolicyStatus.Active, "None");
            m_policySet.Policies.Add(policy1);
            m_policySet.Policies.Add(policy2);
            m_policySet.Policies.Add(policy3);

            //set up test object
            DeleteAllPoliciesState state = new DeleteAllPoliciesStateTester();
            state.PolicySet = m_policySet;
            state.StateMachine = (IStateMachine)m_stateMachine.MockInstance;
            MDIChildForm childForm = (MDIChildForm)m_childForm.MockInstance;
            ITreeViewController treeViewController = (ITreeViewController)m_treeViewController.MockInstance;

            //set up mocks
            object[] args = new object[0] { };
            m_stateMachine.ExpectAndReturn("get_ChildForm", childForm, args);
            m_childForm.ExpectAndReturn("get_TreeViewController", treeViewController,args);
            m_treeViewController.Expect("set_Model", m_policySet);
            m_stateMachine.ExpectAndReturn("get_ChildForm", childForm, args);
            m_childForm.ExpectAndReturn("get_TreeViewController", treeViewController, args);
            m_treeViewController.Expect("Display", args);
            m_stateMachine.ExpectAndReturn("get_ChildForm", childForm, args);
            m_childForm.Expect("set_IsModified", true);
            IState showPoliciesState = new ShowPoliciesState();
            m_stateMachine.ExpectAndReturn("GetState", showPoliciesState, StateTypeEnum.ShowPolicies);
            m_stateMachine.Expect("SetState", showPoliciesState);

            //test policies exist
            Assert.AreEqual(3, m_policySet.Policies.Count, "Unexpected number of policies in policy set");

            //delete all policies
            state.Enter();

            //test policies are gone
            Assert.AreEqual(0, m_policySet.Policies.Count, "Unexpected number of conditions in conditionGroup.Conditions");

            m_stateMachine.Verify();
            m_childForm.Verify();
            m_treeViewController.Verify();
        }
        public void TestDeleteAllConditions_NoPolicies()
        {
            //set up test object
            DeleteAllPoliciesState state = new DeleteAllPoliciesStateTester();
            state.PolicySet = m_policySet;
            state.StateMachine = (IStateMachine)m_stateMachine.MockInstance;

            //set up mocks
            IState showPoliciesState = new ShowPoliciesState();
            m_stateMachine.ExpectAndReturn("GetState", showPoliciesState, StateTypeEnum.ShowPolicies);
            m_stateMachine.Expect("SetState", showPoliciesState);

            //test policies exist
            Assert.AreEqual(0, m_policySet.Policies.Count, "Unexpected number of policies in policy set");

            //delete all policies
            state.Enter();

            //test policies are gone
            Assert.AreEqual(0, m_policySet.Policies.Count, "Unexpected number of conditions in conditionGroup.Conditions");

            m_stateMachine.Verify();
        }