Exemplo n.º 1
0
 public void Execute(BindingEnvironment environment)
 {
     while (BooleanPredicates.IsTrue(this.condition.Evaluate(environment)))
     {
         this.command.Execute(environment);
     }
 }
Exemplo n.º 2
0
        public void IsTrue()
        {
            Assert.IsFalse(BooleanPredicates.IsTrue(null));
            Assert.IsFalse(BooleanPredicates.IsTrue(string.Empty));
            Assert.IsFalse(BooleanPredicates.IsTrue(0));
            Assert.IsFalse(BooleanPredicates.IsTrue((short)0));
            Assert.IsFalse(BooleanPredicates.IsTrue((long)0));
            Assert.IsFalse(BooleanPredicates.IsTrue(0.0));
            Assert.IsFalse(BooleanPredicates.IsTrue((float)0.0));

            Assert.IsTrue(BooleanPredicates.IsTrue(new object()));
            Assert.IsTrue(BooleanPredicates.IsTrue("foo"));
            Assert.IsTrue(BooleanPredicates.IsTrue(1));
            Assert.IsTrue(BooleanPredicates.IsTrue((short)2));
            Assert.IsTrue(BooleanPredicates.IsTrue((long)3));
            Assert.IsTrue(BooleanPredicates.IsTrue(4.0));
            Assert.IsTrue(BooleanPredicates.IsTrue((float)5.0));
        }