public IActionResult GetDetails(int repoId) { try { return(PartialView("DetailedRepo", _service.GetInfo(repoId))); } catch (Exception) { return(BadRequest()); } }
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)); }