Skip to content

Commit

Permalink
Fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ardalis committed May 25, 2024
1 parent 81c451a commit 111c52b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void ReturnsInvalidResultWith2ErrorsGivenSomeLongNameSurname()
}

[Fact]
public void ReturnsConflictResultGivenExistPerson()
public void ReturnsConflictResultGivenExistingPerson()
{
var service = new PersonService();
string firstName = "John";
Expand All @@ -39,6 +39,6 @@ public void ReturnsConflictResultGivenExistPerson()
var result = service.Create(firstName, lastName);

result.Status.Should().Be(ResultStatus.Conflict);
result.Errors.Single().Should().Be($"Person ({firstName} {lastName}) is exist");
result.Errors.Single().Should().Be($"Person ({firstName} {lastName}) already exists in the system");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public async Task ReturnsConflictGivenExistPerson(string route)
var problemDetails = JsonConvert.DeserializeObject<ProblemDetails>(stringResponse);

Assert.Contains("There was a conflict.", problemDetails.Title);

Check warning on line 45 in sample/Ardalis.Result.SampleWeb.FunctionalTests/PersonControllerCreate.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 45 in sample/Ardalis.Result.SampleWeb.FunctionalTests/PersonControllerCreate.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 45 in sample/Ardalis.Result.SampleWeb.FunctionalTests/PersonControllerCreate.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.
Assert.Contains("Next error(s) occurred:* Person (John Smith) is exist", problemDetails.Detail);
Assert.Contains("Next error(s) occurred:* Person (John Smith) already exists in the system", problemDetails.Detail);
Assert.Equal(409, problemDetails.Status);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public async Task ReturnsNotFoundGivenUnknownId(string route)
var problemDetails = JsonConvert.DeserializeObject<ProblemDetails>(stringResponse);

Assert.Contains("Resource not found.", problemDetails.Title);

Check warning on line 53 in sample/Ardalis.Result.SampleWeb.FunctionalTests/PersonControllerDelete.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 53 in sample/Ardalis.Result.SampleWeb.FunctionalTests/PersonControllerDelete.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.

Check warning on line 53 in sample/Ardalis.Result.SampleWeb.FunctionalTests/PersonControllerDelete.cs

View workflow job for this annotation

GitHub Actions / build

Dereference of a possibly null reference.
Assert.Contains("Person Not Found", problemDetails.Detail);
Assert.Contains("Person with id 2 Not Found", problemDetails.Detail);
Assert.Equal(404, problemDetails.Status);
}

Expand Down

0 comments on commit 111c52b

Please sign in to comment.