public void GetAllFavoritiesService_ReturnsEmptyRepositoryList()
        {
            // Arrange
            var mockGitHubRepoRepository = new Mock<IGitHubRepoRepository>();
            var mockUnitOfWork = new Mock<IUnitOfWork>();

            mockGitHubRepoRepository.Setup(s => s.GetAll()).Returns(new List<GitHubRepo>());

            var svc = new GitHubRepoService(mockGitHubRepoRepository.Object, mockUnitOfWork.Object);

            // Act
            var result = (List<GitHubRepo>)svc.GetAllFavorities();

            // Assert
            Assert.IsTrue(result.Count == 0);
        }
        public void GetAllFavoritiesService_ReturnsNullRepositoryList()
        {
            // Arrange
            var mockGitHubRepoRepository = new Mock<IGitHubRepoRepository>();
            var mockUnitOfWork = new Mock<IUnitOfWork>();

            List<GitHubRepo> favRepolist = null;

            mockGitHubRepoRepository.Setup(s => s.GetAll()).Returns(favRepolist);

            var svc = new GitHubRepoService(mockGitHubRepoRepository.Object, mockUnitOfWork.Object);

            // Act
            var result = (List<GitHubRepo>)svc.GetAllFavorities();

            // Assert
            Assert.IsNull(result);
        }
        public void GetAllFavoritiesService_ReturnsRepositoriesList()
        {
            // Arrange
            var mockGitHubRepoRepository = new Mock<IGitHubRepoRepository>();
            var mockUnitOfWork = new Mock<IUnitOfWork>();

            // create a list of repositories to return
            var userRepositories = (List<GitHubRepo>)MockHelper.GenerateFakeRepos("fakeUserName");

            mockGitHubRepoRepository.Setup(s => s.GetAll()).Returns(userRepositories);

            var svc = new GitHubRepoService(mockGitHubRepoRepository.Object, mockUnitOfWork.Object);

            // Act
            var result = (List<GitHubRepo>)svc.GetAllFavorities();

            // Assert
            Assert.IsTrue(result.Count == userRepositories.Count);
        }