Moq.Mock<T> - how to set up a method that takes an expression
问题 I am Mocking my repository interface and am not sure how to set up a method that takes an expression and returns an object? I am using Moq and NUnit. Interface: public interface IReadOnlyRepository : IDisposable { IQueryable<T> All<T>() where T : class; T Single<T>(Expression<Func<T, bool>> expression) where T : class; } Test with IQueryable is already set up, but don't know how to set up the T Single: private Moq.Mock<IReadOnlyRepository> _mockRepos; private AdminController _controller;