示例#1
0
        public void TestAll()
        {
            // Define variables and constants
            IEnumerable <int> passingCollection = new[] {
                1, 2, 7, 31, 99, 12
            };
            IEnumerable <int> failingCollection = new[] {
                5, 136, 136, 76, 8, 32, 0
            };

            // Set up context


            // Execute
            Assure.All(passingCollection, i => i > 0);
            try {
                Assure.All(failingCollection, i => i > 0);
                Assert.Fail();
            }
            catch (AssuranceFailedException) {
            }

            // Assert outcome
        }