From ca739ad64fabc850a7d66042aaa916d48927f65d Mon Sep 17 00:00:00 2001 From: yv01p Date: Sun, 21 Dec 2025 03:50:09 +0000 Subject: [PATCH] fix(tests): correct exception type expectation in ContentCrudServiceTests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Create_WithNonExistentContentType test expected ArgumentException but ContentCrudService correctly throws generic Exception to match the original ContentService behavior (behavioral parity). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../Umbraco.Core/Services/ContentCrudServiceTests.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/ContentCrudServiceTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/ContentCrudServiceTests.cs index e5808f38ad..621575fb11 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/ContentCrudServiceTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/ContentCrudServiceTests.cs @@ -133,7 +133,7 @@ public class ContentCrudServiceTests } [Test] - public void Create_WithNullContentType_ThrowsArgumentException() + public void Create_WithNonExistentContentType_ThrowsException() { // Arrange CreateMockScopeWithReadLock(); @@ -141,7 +141,8 @@ public class ContentCrudServiceTests .Returns(Enumerable.Empty()); // Act & Assert - Assert.Throws(() => + // Note: Throws generic Exception to match original ContentService behavior + Assert.Throws(() => _sut.Create("Test", Constants.System.Root, "nonExistentType")); }