public void EnvironmentRepositoryFindWithNonMatchingCriteriaExpectedReturnsEmptyList() { var source = CreateMockEnvironment(); var e1 = CreateMockEnvironment(); var e2 = CreateMockEnvironment(); var repo = new TestEnvironmentRespository(source.Object, e1.Object, e2.Object); var actual = repo.Find(e => e.ID == Guid.NewGuid()).ToList(); Assert.AreEqual(0, actual.Count); }
public void EnvironmentRepositoryFindWithNullExpectedReturnsEmptyList() { var source = CreateMockEnvironment(); var e1 = CreateMockEnvironment(); var e2 = CreateMockEnvironment(); var repo = new TestEnvironmentRespository(source.Object, e1.Object, e2.Object); var actual = repo.Find(null); Assert.AreEqual(0, actual.Count); }
public void EnvironmentRepositoryFindWithMatchingCriteriaExpectedReturnsMatchingList() { var source = CreateMockEnvironment(); var e1 = CreateMockEnvironment(); var e2 = CreateMockEnvironment(); var repo = new TestEnvironmentRespository(source.Object, e1.Object, e2.Object); var actual = repo.Find(e => e.ID == e1.Object.ID).ToList(); Assert.AreEqual(1, actual.Count); Assert.AreSame(e1.Object, actual[0]); }