コード例 #1
0
        public async Task DeveInserirCliente()
        {
            _fixture.ClearDataBase();
            var clienteBuilder = new ClienteBuilder().ComNome("Cliente 02").Instanciar();

            var request = new HttpRequestMessageBuilder()
                          .ComMethod(HttpMethod.Post)
                          .ComUrl("api/Client/PostAsync")
                          .ComBody(clienteBuilder)
                          .Instanciar();

            var response = await _fixture.Client.SendAsync(request);

            var resultado = await _clientRepository.GetByIdAsync(1);

            response.IsSuccessStatusCode.Should().BeTrue();
            response.StatusCode.Should().Be(HttpStatusCode.OK);
            resultado.Id.Should().Be(1);
            resultado.Nome.Should().Be("Cliente 02");
            resultado.SobreNome.Should().Be("Sobre Nome Cliente");
        }