public IActionResult GetRepository([FromServices] ShowCodeRepository rep)
        {
            try
            {
                var code = rep.ShowTheCode(CodeGit.Url);

                return(Ok(code));
            }
            catch (Exception e)
            {
                return(StatusCode(500, e.Message));
            }
        }
Example #2
0
        public void ShowCodeTest()
        {
            try
            {
                var code   = new ShowCodeRepository();
                var result = code.ShowTheCode(CodeGit.Url);

                Assert.IsTrue(result != "");
            }
            catch (Exception e)
            {
                Assert.Fail("Falha: " + e.Message);
            }
        }