public void ShouldReturnAllDataOnGetQueryable() { using (var context = new TestDbContext(_inMemoryDbOptions)) { var subject = new TestableRepository(context); var result = subject.GetQueryable(); result.Should().BeEquivalentTo(TestData); } }
public void ShouldReturnFilteredDataWhenGlobalFilterIsSet() { using (var context = new TestDbContext(_inMemoryDbOptions)) { var subject = new TestableRepository(context); subject.SetGlobalFilter(t => t.TenantId == FirstTenantId); var result = subject.GetQueryable(); result.Count().Should().Be(TestData.Count(t => t.TenantId == FirstTenantId)); } }