예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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]);
        }