public void Index()
        {
            // Arrange
            RepositoryController controller = new RepositoryController();

            // Act
            ViewResult result = controller.Index() as ViewResult;

            // Assert
            Assert.IsNotNull(result);
        }
Exemplo n.º 2
0
        public void Index()
        {
            // Arrange
            RepositoryController controller = new RepositoryController();

            // Act
            ViewResult result = controller.Index("https://api.github.com/users/ShaunWatson24/repos") as ViewResult;

            // Assert
            result.Should().NotBeNull();
            var repos = ((IEnumerable <GitHubRepository>)result.ViewData.Model).ToList();

            repos.Count.Should().Be(5);
            var repo = repos.FirstOrDefault();

            repo.RepositoryName.Should().Be("GetGitHubUser");
            repo.RepositoryUrl.Should().Be("https://github.com/ShaunWatson24/GetGitHubUser");
            repo.StargazerCount.Should().Be(1);
            repo.Description.Should().Be(null);
        }