From 111c52bb70c0a9310b56e9d8c48661750d1b7de4 Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Sat, 25 May 2024 12:52:18 -0400 Subject: [PATCH] Fix broken tests --- .../ServiceTests/PersonServiceCreate.cs | 4 ++-- .../PersonControllerCreate.cs | 2 +- .../PersonControllerDelete.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sample/Ardalis.Result.Sample.UnitTests/ServiceTests/PersonServiceCreate.cs b/sample/Ardalis.Result.Sample.UnitTests/ServiceTests/PersonServiceCreate.cs index 10b24bd..da61081 100644 --- a/sample/Ardalis.Result.Sample.UnitTests/ServiceTests/PersonServiceCreate.cs +++ b/sample/Ardalis.Result.Sample.UnitTests/ServiceTests/PersonServiceCreate.cs @@ -30,7 +30,7 @@ public void ReturnsInvalidResultWith2ErrorsGivenSomeLongNameSurname() } [Fact] - public void ReturnsConflictResultGivenExistPerson() + public void ReturnsConflictResultGivenExistingPerson() { var service = new PersonService(); string firstName = "John"; @@ -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"); } } diff --git a/sample/Ardalis.Result.SampleWeb.FunctionalTests/PersonControllerCreate.cs b/sample/Ardalis.Result.SampleWeb.FunctionalTests/PersonControllerCreate.cs index 6feb50e..142d363 100644 --- a/sample/Ardalis.Result.SampleWeb.FunctionalTests/PersonControllerCreate.cs +++ b/sample/Ardalis.Result.SampleWeb.FunctionalTests/PersonControllerCreate.cs @@ -43,7 +43,7 @@ public async Task ReturnsConflictGivenExistPerson(string route) var problemDetails = JsonConvert.DeserializeObject(stringResponse); Assert.Contains("There was a conflict.", problemDetails.Title); - 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); } } diff --git a/sample/Ardalis.Result.SampleWeb.FunctionalTests/PersonControllerDelete.cs b/sample/Ardalis.Result.SampleWeb.FunctionalTests/PersonControllerDelete.cs index 4234a1e..86727b8 100644 --- a/sample/Ardalis.Result.SampleWeb.FunctionalTests/PersonControllerDelete.cs +++ b/sample/Ardalis.Result.SampleWeb.FunctionalTests/PersonControllerDelete.cs @@ -51,7 +51,7 @@ public async Task ReturnsNotFoundGivenUnknownId(string route) var problemDetails = JsonConvert.DeserializeObject(stringResponse); Assert.Contains("Resource not found.", problemDetails.Title); - Assert.Contains("Person Not Found", problemDetails.Detail); + Assert.Contains("Person with id 2 Not Found", problemDetails.Detail); Assert.Equal(404, problemDetails.Status); }