1 year ago

#20654

test-img

dgzargo

Microsoft Fakes shim for generic method with anonymous class

I'm trying to use a shim ShimEnumerable.CountOf1IEnumerableOfM0, but in my method, the extension method is used with an anonymous type like that:

elements
    .GroupBy(
        element => new
            {
                A = element.A,
                B = element.B,
            }
    )
    .Select(grouping => grouping.Count())

How to shim the Count method?

c#

generics

microsoft-fakes

shim

0 Answers

Your Answer

Accepted video resources