Esempio n. 1
0
        private IEnumerable <ICountingStrategy> ForSimpleEnumerable()
        {
            var type     = values.GetType();
            var property = type.GetProperty("Count", BindingFlags.Instance | BindingFlags.Public, null, typeof(int), EmptyArray <Type> .Instance, null);

            if (property != null)
            {
                yield return(CountingStrategy.ByReflectedCountGetter(() => (int)property.GetValue(values, null)));
            }

            yield return(CountingStrategy.ByEnumeratingElements(values));
        }