public void GetAllFamilies_ExpectedNotNullOrEmpty() { // Arrange var contextMock = new Mock <DBContext>(); contextMock.Setup(f => f.Families).ReturnsDbSet(GetTestFamilies()); var logger = Mock.Of <ILogger <FamilyRepository> >(); var familyRepository = new FamilyRepository(contextMock.Object, logger); // Act var expected = familyRepository.GetAllFamilies(false); // Assert Assert.NotNull(expected.Result); Assert.NotEmpty(expected.Result); }