public static IReturnsResult <TMock> SetupAsyncEntitySet <TMock, TResult>(this Mock <TMock> mock, Expression <Func <TMock, IEntitySet <TResult> > > expression, IList <TResult> items) where TMock : Mock <TMock> where TResult : class { var fakeDbSet = new FakeAsyncDbSet <TResult>(items); return(mock.Setup(expression).Returns(new FakeEntitySet <TResult>(items))); }
public static IReturnsResult <TMock> ReturnsAsyncEntitySet <TMock, TResult>(this ISetup <TMock, IEntitySet <TResult> > setup, IList <TResult> items) where TMock : class where TResult : class { var fakeDbSet = new FakeAsyncDbSet <TResult>(items); return(setup.Returns(new FakeAsyncEntitySet <TResult>(fakeDbSet))); }