Exemplo n.º 1
0
        public async Task CreateIssueWithNotValidData_ShouldReturnBadRequest()
        {
            var command = new UpdateIssue(
                Guid.Empty,
                IssueType.Task,
                null,
                null
                );

            var response = await _sut.Client.PutAsync($"/api/Issues/{command.Id}", command.ToJsonStringContent());

            response.StatusCode.Should().Be(HttpStatusCode.BadRequest);
        }
Exemplo n.º 2
0
        private async Task <IssueView> UpdateIssue(UpdateIssue command)
        {
            var response = await _sut.Client.PutAsync($"/api/Issues/{command.Id}", command.ToJsonStringContent());

            response.EnsureSuccessStatusCode();
            response.StatusCode.Should().Be(HttpStatusCode.OK);

            var issue = await GetIssue(command.Id);

            issue.Should().NotBeNull();
            issue.Id.Should().Be(command.Id);
            issue.Type.Should().Be(command.Type);
            issue.Title.Should().Be(command.Title);
            issue.Description.Should().Be(command.Description);

            return(issue);
        }