Exemple #1
0
            public async Task Deve_Consultar_Por_Cnpj()
            {
                // Arrange

                var listaTransicao = new List <Transacao>();

                listaTransicao.Add(new Transacao {
                    MerchantCnpj = "77404852000179"
                });
                listaTransicao.Add(new Transacao {
                    MerchantCnpj = "77404852000179"
                });
                listaTransicao.Add(new Transacao {
                    MerchantCnpj = "77404852000179"
                });


                transacaoServiceMock
                .Setup(x => x.ConsultaPorCnpj("77404852000179"))
                .ReturnsAsync(listaTransicao);

                // Act
                var result = await ControllerUnderTest.ConsultaPorCnpj("77404852000179");

                // Assert
                var okResult = Assert.IsType <OkObjectResult>(result);

                Assert.Same(listaTransicao, okResult.Value);
            }