Esempio n. 1
0
        public void __should_all_be__checks_each_item_in_target_enumerable_against_a_lambda()
        {
            // passing a lambda in a closure works around the dynamic issues.
            var pass = Check.That(subject).container[Should.AllBe(o => o is string, "All items should be strings")];
            var fail = Check.That(subject).container[Should.AllBe(o => (string)o == "two", "Expected all items to be 'two'")];

            Assert.That(pass.Success);
            Assert.That(fail.Success, Is.False);
            Assert.That(fail.Reasons, Contains.Item("Outer.container Expected all items to be 'two'"));
        }