我想模拟该方法DbSet.toList
,但我总是得到一个异常,因为该toList
方法是在IEnumerable
.
测试方法 SocialSWT.Tests.Repository.RepositoryTest.GetCallsListOfEntities 抛出异常:System.NotSupportedException:表达式引用了不属于模拟对象的方法:foo => foo.ToList()
dbSet.Setup(foo => foo.ToList()).Returns(mockList);