Пример #1
0
        /// <summary>
        ///     Checks that the enumerable contains only the given expected values and nothing else, in order.
        ///     This check should only be used with IEnumerable that have a consistent iteration order
        ///     (i.e. don't use it with Hashtable, prefer <see cref="IsOnlyMadeOf{T}" /> in that case).
        /// </summary>
        /// <typeparam name="T">Type of the elements to be found.</typeparam>
        /// <typeparam name="TU"></typeparam>
        /// <param name="check">The fluent check to be extended.</param>
        /// <param name="expectedValues">The expected values to be found.</param>
        /// <returns>
        ///     A check link.
        /// </returns>
        /// <exception cref="FluentCheckException">
        ///     The enumerable does not contains only the exact given values and nothing else,
        ///     in order.
        /// </exception>
        public static ICheckLink <ICheck <TU> > ContainsExactly <TU, T>(
            this ICheck <TU> check,
            params T[] expectedValues) where TU : IEnumerable
        {
            var properExpectedValues = ExtractEnumerableValueFromPossibleOneValueArray(expectedValues);

            return(check.ContainsExactly(properExpectedValues));
        }