示例#1
0
            public void Should_Return_An_List_Of_Folders()
            {
                // Given
                var fixture = new AutoAddServiceFixture();

                fixture.AutoAddRepository.GetFolders().Returns(info => new[] { new Folder() });
                var service = fixture.CreateAutoAddService();

                // When
                var result = service.GetFolders();

                // Then
                Assert.Equal(1, result.Count());
            }
示例#2
0
            public void Should_Return_An_Empty_List_If_Repository_Is_Null()
            {
                // Given
                var fixture = new AutoAddServiceFixture();

                fixture.AutoAddRepository.GetFolders().Returns(info => null);
                var service = fixture.CreateAutoAddService();

                // When
                var result = service.GetFolders();

                // Then
                Assert.Equal(Enumerable.Empty <Folder>(), result);
            }