mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-09 23:55:10 -05:00
#31 (upstream) Add http context handling to tests
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
using Moq;
|
using Moq;
|
||||||
using Moq.Protected;
|
using Moq.Protected;
|
||||||
using octo_fiesta.Models.Settings;
|
using octo_fiesta.Models.Settings;
|
||||||
@@ -27,7 +28,13 @@ public class SubsonicProxyServiceTests
|
|||||||
Url = "http://localhost:4533"
|
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]
|
[Fact]
|
||||||
|
|||||||
Reference in New Issue
Block a user