Ejemplo n.º 1
0
        public async Task Conta_RealizarTransferencia_Sucesso()
        {
            //Arrange
            var         url           = $"api/v1/conta/Transferencia";
            var         userViewModel = _testsFixture.GerarLancamento();
            HttpContent content       = new StringContent(JsonConvert.SerializeObject(userViewModel), Encoding.UTF8, "application/json");
            var         postRequest   = new HttpRequestMessage(HttpMethod.Post, url)
            {
                Content = content
            };

            // Act
            var postResponse = await _testsFixture.Client.SendAsync(postRequest);

            // Assert
            postResponse.EnsureSuccessStatusCode();
            var result = JsonConvert.DeserializeObject <Response>(await postResponse.Content.ReadAsStringAsync());
            var isOk   = result.success;

            Assert.True(isOk);
        }