Unit testing a Func<Delegate> with Rhino Mocks throwing InvalidCastException with second Expect() invocation
问题 I'm unit testing a class that gets some parameters injected by Autofac. Some of the parameters are Func<Delegate> . This allows me to create multiple delegates to use. Refer to this Autofac Wiki page if you need a better description. Here's part of the class. public class CreateProductCommand : TransactionalDBCommandBase<ProductImpl> { public delegate CreateProductCommand Factory(ProductInfo info, IAppSecurityContext context); private ProductInfo _info; private Func<SaveTextMasterCommand