no message

This commit is contained in:
Roger Far 2026-04-27 20:10:34 -06:00
parent b037809c0e
commit 147b1db4a5
2 changed files with 19 additions and 7 deletions

View file

@ -22,7 +22,7 @@ public class QBittorrentControllerTest
_qBittorrentMock.Object, _qBittorrentMock.Object,
new Mock<IHttpClientFactory>().Object); new Mock<IHttpClientFactory>().Object);
_controller.ControllerContext = new ControllerContext _controller.ControllerContext = new()
{ {
HttpContext = new DefaultHttpContext() HttpContext = new DefaultHttpContext()
}; };
@ -43,7 +43,7 @@ public class QBittorrentControllerTest
}); });
// Act // Act
var result = await _controller.TorrentsInfo(new QBTorrentsInfoRequest var result = await _controller.TorrentsInfo(new()
{ {
Filter = "all", Filter = "all",
Hashes = "hash1" Hashes = "hash1"
@ -77,7 +77,7 @@ public class QBittorrentControllerTest
}); });
// Act // Act
var result = await _controller.TorrentsInfo(new QBTorrentsInfoRequest var result = await _controller.TorrentsInfo(new()
{ {
Filter = "completed" Filter = "completed"
}); });

View file

@ -43,8 +43,14 @@ public class SabnzbdHandlerTest
{ {
// Arrange // Arrange
Settings.Get.General.AuthenticationType = AuthenticationType.UserNamePassword; Settings.Get.General.AuthenticationType = AuthenticationType.UserNamePassword;
var httpContext = new DefaultHttpContext(); var httpContext = new DefaultHttpContext
httpContext.Request.QueryString = new("?ma_username=user&ma_password=pass"); {
Request =
{
QueryString = new("?ma_username=user&ma_password=pass")
}
};
_httpContextAccessorMock.Setup(a => a.HttpContext).Returns(httpContext); _httpContextAccessorMock.Setup(a => a.HttpContext).Returns(httpContext);
var context = CreateContext(httpContext); var context = CreateContext(httpContext);
@ -81,8 +87,14 @@ public class SabnzbdHandlerTest
{ {
// Arrange // Arrange
Settings.Get.General.AuthenticationType = AuthenticationType.UserNamePassword; Settings.Get.General.AuthenticationType = AuthenticationType.UserNamePassword;
var httpContext = new DefaultHttpContext(); var httpContext = new DefaultHttpContext
httpContext.Request.QueryString = new("?ma_username=user&ma_password=wrong"); {
Request =
{
QueryString = new("?ma_username=user&ma_password=wrong")
}
};
_httpContextAccessorMock.Setup(a => a.HttpContext).Returns(httpContext); _httpContextAccessorMock.Setup(a => a.HttpContext).Returns(httpContext);
var context = CreateContext(httpContext); var context = CreateContext(httpContext);