GetConditions() 공개 메소드

public GetConditions ( ) : Condition[]
리턴 Condition[]
예제 #1
0
        public void AndConditionTest()
        {
            // Positive test
            Condition condition = Condition.TrueCondition;
            Condition condition2 = Condition.FalseCondition;
            AndCondition target = new AndCondition(condition, condition2);
            Condition[] actual;
            actual = target.GetConditions();
            Assert.IsNotNull(actual);
            Assert.AreEqual(actual.Length, 2);

            // Negative test - include a null
            try
            {
                target = new AndCondition(condition, null);

                Assert.Fail("expected exception");
            }
            catch (System.ArgumentException)
            {
            }
        }
예제 #2
0
        protected void displayConditions(
            GetControlCmdletBase cmdlet,
            AndCondition conditions,
            string description)
        {
            try {
                Condition[] conds = conditions.GetConditions();
                for (int i = 0; i < conds.Length; i++) {
                    cmdlet.WriteVerbose(cmdlet, "<<<< displaying conditions '" + description + "' >>>>");
                    cmdlet.WriteVerbose(cmdlet, (conds[i] as PropertyCondition).Property.ProgrammaticName);
                    cmdlet.WriteVerbose(cmdlet, (conds[i] as PropertyCondition).Value.ToString());
                    cmdlet.WriteVerbose(cmdlet, (conds[i] as PropertyCondition).Flags.ToString());

                }
            }
            catch {}
        }