Esempio n. 1
0
 public IActionResult GetDetails(int repoId)
 {
     try
     {
         return(PartialView("DetailedRepo", _service.GetInfo(repoId)));
     }
     catch (Exception)
     {
         return(BadRequest());
     }
 }
Esempio n. 2
0
        public void ShouldPersistAndReturnRepos()
        {
            var languages = new List <string>
            {
                Language.Python.ToString()
            };

            //Test service with memory db and mocked api
            _service.FindAndSaveRepos(languages)
            .Should().NotContainNulls()
            .And.HaveCount(ListSize);

            //Test retrieving saved repo with random Id
            _service.GetInfo(new Random().Next(1, ListSize))
            .Should().NotBeNull().And.BeOfType(typeof(GitRepos.Models.Repository));
        }