Beispiel #1
0
        public void Retornar_repositorios_com_sucesso()
        {
            _repositorioGitServico.Setup(s => s.ObterLinks())
            .Returns(_repositorioGit);

            var retorno     = _showMeTheCodeController.Get();
            var resultadoOk = retorno as OkObjectResult;

            retorno.Should().NotBeNull();
            resultadoOk.StatusCode.Should().Be((int)HttpStatusCode.OK);
            resultadoOk.Value.As <RepositorioGit>().Should().Be(_repositorioGit);
            _repositorioGitServico.Verify();
        }
        public void ShouldReturnGithubRepository()
        {
            var actual   = Assert.IsType <OkObjectResult>(_showMeTheCodeController.Get());
            var expected = "https://github.com/gabrielschmith/SoftplanCalc";

            Assert.Equal(expected, actual.Value);
        }
Beispiel #3
0
        public void TestShowMeTheCode()
        {
            ShowMeTheCodeController showMeTheCodeController = new ShowMeTheCodeController();
            var response = showMeTheCodeController.Get();

            Assert.AreEqual("https://github.com/cdcunha/CalculaJuros", response.Value);
        }
Beispiel #4
0
        public void GetShowMeTheCodeOk()
        {
            ShowMeTheCodeController controller = new ShowMeTheCodeController();

            string url = controller.Get();

            Assert.Equal("https://github.com/biadreveck/softplan-desafio", url);
        }
Beispiel #5
0
        public void ShowMeTheCode_Get_Url()
        {
            // Arrange
            var expected = "https://github.com/wevertonpaulino/juros-compostos-csharp";

            // Act
            var actual = _controller.Get();

            // Assert
            Assert.Equal(expected, actual);
        }
Beispiel #6
0
        public void TestLinkGit()
        {
            // Arrange
            var controller = new ShowMeTheCodeController();

            // Act
            var result = controller.Get();

            // Assert
            Assert.Equal("https://github.com/ViniziSuricate/juros", result.ToString());
        }
Beispiel #7
0
        public void Retornar_Url_ResultadoTrue()
        {
            ShowMeTheCodeController _sm = new ShowMeTheCodeController();

            ObjectResult retorno = (ObjectResult)_sm.Get();

            var resultado = (string)retorno.Value;
            var url       = "https://github.com/josercarvalho/Softplan";

            bool result = (resultado == url);

            Assert.IsTrue(result, "Retorno positivo");
        }