diff options
| author | zerafachris <christopher.zerafa@blocklabs.io> | 2026-07-21 08:51:30 +0200 |
|---|---|---|
| committer | zerafachris <christopher.zerafa@blocklabs.io> | 2026-07-21 08:51:30 +0200 |
| commit | 53e58d8b1b61c44405322bf91a8aa230f02b8323 (patch) | |
| tree | 0df6968ae31244a37842be71c7e0b0c987b2ed34 /tests | |
| parent | 5cd3d7ebb7c8ce5b7cf68b0696543780215a6fff (diff) | |
Make ItemUpdateController.UpdateItem internal instead of reflection
Addresses review feedback from @Bond-009 on PR #17370: the test helper
InvokeUpdateItem was invoking the private UpdateItem(BaseItemDto, BaseItem)
method via reflection. Jellyfin.Api.csproj already grants
InternalsVisibleTo("Jellyfin.Api.Tests"), so the method is changed to
internal and the test now calls it directly, removing the
GetMethod/Invoke boilerplate.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/Jellyfin.Api.Tests/Controllers/ItemUpdateControllerTests.cs | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/tests/Jellyfin.Api.Tests/Controllers/ItemUpdateControllerTests.cs b/tests/Jellyfin.Api.Tests/Controllers/ItemUpdateControllerTests.cs index fa167203dd..1a91efe4f2 100644 --- a/tests/Jellyfin.Api.Tests/Controllers/ItemUpdateControllerTests.cs +++ b/tests/Jellyfin.Api.Tests/Controllers/ItemUpdateControllerTests.cs @@ -1,5 +1,4 @@ using System; -using System.Reflection; using System.Threading.Tasks; using Jellyfin.Api.Controllers; using MediaBrowser.Controller.Configuration; @@ -73,15 +72,6 @@ public class ItemUpdateControllerTests private Task InvokeUpdateItem(BaseItemDto request, BaseItem item) { - var method = typeof(ItemUpdateController).GetMethod( - "UpdateItem", - BindingFlags.NonPublic | BindingFlags.Instance, - null, - new[] { typeof(BaseItemDto), typeof(BaseItem) }, - null); - - Assert.NotNull(method); - - return (Task)method!.Invoke(_subject, new object[] { request, item })!; + return _subject.UpdateItem(request, item); } } |
