public void BeContainWithoutComparerTest()
        {
            var list = new List <int> {
                1, 2, 3, 4, 5, 6, 7, 8, 9, 10
            };

            var val0 = Colls.BeContainedIn(10, list);
            var val1 = Colls.BeContainedIn(11, list);

            val0.ShouldBeTrue();
            val1.ShouldBeFalse();
        }
        public void BeContainWithComparerTest()
        {
            var list = new List <int> {
                1, 2, 3, 4, 5, 6, 7, 8, 9, 10
            };
            var comparer = EqualityComparer <int> .Default;

            var val0 = Colls.BeContainedIn(10, list, comparer);
            var val1 = Colls.BeContainedIn(11, list, comparer);

            val0.ShouldBeTrue();
            val1.ShouldBeFalse();
        }
        public void BeContainWithGivenExpressionAndWithoutComparerTest()
        {
            var list = new List <int> {
                1, 2, 3, 4, 5, 6, 7, 8, 9, 10
            };

            var val0 = Colls.BeContainedIn(9, list, v => v > 8);
            var val1 = Colls.BeContainedIn(10, list, v => v > 10);
            var val2 = Colls.BeContainedIn(11, list, v => v > 11);

            val0.ShouldBeTrue();
            val1.ShouldBeFalse();
            val2.ShouldBeFalse();
        }
        public void BeContainWithGivenExpressionAndWithComparerTest()
        {
            var list = new List <int> {
                1, 2, 3, 4, 5, 6, 7, 8, 9, 10
            };
            var comparer = EqualityComparer <int> .Default;

            var val0 = Colls.BeContainedIn(9, list, v => v > 8, comparer);
            var val1 = Colls.BeContainedIn(10, list, v => v > 10, comparer);
            var val2 = Colls.BeContainedIn(11, list, v => v > 11, comparer);

            val0.ShouldBeTrue();
            val1.ShouldBeFalse();
            val2.ShouldBeFalse();
        }
Esempio n. 5
0
 public static bool BeContainedIn <T>(this T item, IEnumerable <T> items, Expression <Func <T, bool> > condition, IEqualityComparer <T> equalityComparer)
 {
     return(Colls.BeContainedIn(item, items, condition, equalityComparer));
 }
Esempio n. 6
0
 public static bool BeContainedIn <T>(this T item, IEnumerable <T> items, Expression <Func <T, bool> > condition)
 {
     return(Colls.BeContainedIn(item, items, condition));
 }
Esempio n. 7
0
 public static bool BeContainedIn <T>(this T item, IEnumerable <T> items, IEqualityComparer <T> equalityComparer)
 {
     return(Colls.BeContainedIn(item, items, equalityComparer));
 }
Esempio n. 8
0
 public static bool BeContainedIn <T>(this T item, IEqualityComparer <T> equalityComparer, params T[] items)
 {
     return(Colls.BeContainedIn(item, items, equalityComparer));
 }
Esempio n. 9
0
 public static bool BeContainedIn <T>(this T item, params T[] items)
 {
     return(Colls.BeContainedIn(item, items, EqualityComparer <T> .Default));
 }