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) { } }
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 {} }