#31 (upstream) Add http context handling to tests

This commit is contained in:
bransoned
2026-01-11 19:03:21 -05:00
committed by bransoned
parent ad4a3af41e
commit 428b7f06c4

View File

@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using Microsoft.AspNetCore.Http;
using Moq;
using Moq.Protected;
using octo_fiesta.Models.Settings;
@@ -27,7 +28,13 @@ public class SubsonicProxyServiceTests
Url = "http://localhost:4533"
});
_service = new SubsonicProxyService(_mockHttpClientFactory.Object, settings);
var httpContext = new DefaultHttpContext();
var httpContextAccessor = new HttpContextAccessor
{
HttpContext = httpContext
};
_service = new SubsonicProxyService(_mockHttpClientFactory.Object, settings, httpContextAccessor);
}
[Fact]