From 345646229dd2fc2e703343de473c54fef3e72219 Mon Sep 17 00:00:00 2001 From: Mehdi Hadeli Date: Wed, 21 Aug 2024 21:00:00 +0330 Subject: [PATCH] fix: fix errors in the test --- .../Feature/GettingProductById/GetProductByIdTests.cs | 8 ++++---- .../Features/CreatingProduct/v1/CreateProductTests.cs | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/Vertical.Slice.Template.EndToEndTests/Products/Feature/GettingProductById/GetProductByIdTests.cs b/tests/Vertical.Slice.Template.EndToEndTests/Products/Feature/GettingProductById/GetProductByIdTests.cs index df0f7fe..cf884ce 100644 --- a/tests/Vertical.Slice.Template.EndToEndTests/Products/Feature/GettingProductById/GetProductByIdTests.cs +++ b/tests/Vertical.Slice.Template.EndToEndTests/Products/Feature/GettingProductById/GetProductByIdTests.cs @@ -88,7 +88,7 @@ public async Task must_returns_not_found_status_code_when_product_with_given_id_ { pr.Detail.Should().Be($"product with id {notExistsId} not found"); pr.Title.Should().Be(nameof(NotFoundException)); - pr.Type.Should().Be("https://tools.ietf.org/html/rfc7231#section-6.5.4"); + pr.Type.Should().Be("https://tools.ietf.org/html/rfc9110#section-15.5.5"); }) .And.Be404NotFound(); @@ -97,7 +97,7 @@ public async Task must_returns_not_found_status_code_when_product_with_given_id_ // .Should() // .HaveError("title", nameof(NotFoundException)) // .And.HaveError("detail", $"product with id {notExistsId} not found") - // .And.HaveError("type", "https://tools.ietf.org/html/rfc7231#section-6.5.4") + // .And.HaveError("type", "https://tools.ietf.org/html/rfc9110#section-15.5.5") // .And.HaveErrorMessage($"product with id {notExistsId} not found") // .And.Be404NotFound(); } @@ -120,7 +120,7 @@ public async Task must_returns_bad_request_status_code_with_empty_id() { pr.Detail.Should().Contain("'Id' must not be empty."); pr.Title.Should().Be(nameof(ValidationException)); - pr.Type.Should().Be("https://tools.ietf.org/html/rfc7231#section-6.5.1"); + pr.Type.Should().Be("https://tools.ietf.org/html/rfc9110#section-15.5.1"); }) .And.Be400BadRequest(); @@ -132,7 +132,7 @@ public async Task must_returns_bad_request_status_code_with_empty_id() // { // Detail = "'Id' must not be empty.", // Title = nameof(ValidationException), - // Type = "https://tools.ietf.org/html/rfc7231#section-6.5.1", + // Type = "https://tools.ietf.org/html/rfc9110#section-15.5.1", // } // ) // .And.Be400BadRequest(); diff --git a/tests/Vertical.Slice.Template.IntegrationTests/Products/Features/CreatingProduct/v1/CreateProductTests.cs b/tests/Vertical.Slice.Template.IntegrationTests/Products/Features/CreatingProduct/v1/CreateProductTests.cs index 4e8b8fa..54ae5ac 100644 --- a/tests/Vertical.Slice.Template.IntegrationTests/Products/Features/CreatingProduct/v1/CreateProductTests.cs +++ b/tests/Vertical.Slice.Template.IntegrationTests/Products/Features/CreatingProduct/v1/CreateProductTests.cs @@ -24,6 +24,7 @@ public async Task should_create_new_product_with_valid_input_in_sql_db() InMemoryLogTrackerProvider.Logs.Informations.Should().NotBeEmpty(); // Arrange + var fakeCategoryId = Guid.NewGuid(); var command = new CreateProductFake(fakeCategoryId).Generate();