public void SetUp() { var logs = new List <Log>(); IdentityLogs = new List <Log>(); for (var i = 0; i < 10; i++) { IdentityLogs.Add( new Log { Id = i, Url = new Uri($"https://test.wearedoubleline.com/{EdFiApiLogService.ApiName}/identity/").ToString(), Method = $"method {i}" }); } logs.AddRange(IdentityLogs); ApiLogs = new List <Log>(); for (var i = 10; i < 20; i++) { ApiLogs.Add( new Log { Id = i, Url = new Uri($"https://test.wearedoubleline.com/{EdFiApiLogService.ApiName}/data/v3/").ToString(), Method = $"method {i}" }); } logs.AddRange(ApiLogs); EntityFrameworkMocks.SetupMockDbSet( EntityFrameworkMocks.GetQueryableMockDbSet(logs), DbContextMock, x => x.Logs, x => x.Logs = It.IsAny <DbSet <Log> >(), logs); DbContextMock.As <IDisposable>().Setup(x => x.Dispose()); DbContextFactoryMock.Setup(x => x.Create()).Returns(DbContextMock.Object); }