コード例 #1
0
        public void Any_When_IDictionary_is_null_It_throws_ArgumentNullException()
        {
            IDictionary <int, int> values = null;
            Func <KeyValuePair <int, int>, bool> predicate = i => i.Value == 0;

            AssertIsNotNull(
                () => Ensure.That(values, ParamName).Any(predicate),
                () => EnsureArg.Any(values, predicate, ParamName));
        }
コード例 #2
0
        public void Any_When_Array_predicate_yields_none_It_throws_ArgumentException()
        {
            var values = new[] { 1, 2, 3, 4 };
            Func <int, bool> predicate = i => i == 0;

            AssertAnyPredicateYieldedNone(
                () => Ensure.That(values, ParamName).Any(predicate),
                () => EnsureArg.Any(values, predicate, ParamName));
        }
コード例 #3
0
        public void Any_When_IList_is_null_It_throws_ArgumentNullException()
        {
            IList <int>      values    = null;
            Func <int, bool> predicate = i => i == 0;

            AssertIsNotNull(
                () => Ensure.That(values, ParamName).Any(predicate),
                () => EnsureArg.Any(values, predicate, ParamName));
        }