소스 검색

Merge pull request #7638 from 1337joe/fix-quick-connect-tests

(cherry picked from commit 7c91543694ffd857d2b42e4c2ec4dca2832d9f82)
Signed-off-by: crobibero <cody@robibe.ro>
Cody Robibero 3 년 전
부모
커밋
e5e7c10b81
1개의 변경된 파일20개의 추가작업 그리고 5개의 파일을 삭제
  1. 20 5
      tests/Jellyfin.Server.Implementations.Tests/QuickConnect/QuickConnectManagerTests.cs

+ 20 - 5
tests/Jellyfin.Server.Implementations.Tests/QuickConnect/QuickConnectManagerTests.cs

@@ -50,7 +50,10 @@ namespace Jellyfin.Server.Implementations.Tests.QuickConnect
 
 
         [Fact]
         [Fact]
         public void IsEnabled_QuickConnectUnavailable_False()
         public void IsEnabled_QuickConnectUnavailable_False()
-            => Assert.False(_quickConnectManager.IsEnabled);
+        {
+            _config.QuickConnectAvailable = false;
+            Assert.False(_quickConnectManager.IsEnabled);
+        }
 
 
         [Theory]
         [Theory]
         [InlineData("", "DeviceId", "Client", "1.0.0")]
         [InlineData("", "DeviceId", "Client", "1.0.0")]
@@ -69,19 +72,31 @@ namespace Jellyfin.Server.Implementations.Tests.QuickConnect
 
 
         [Fact]
         [Fact]
         public void TryConnect_QuickConnectUnavailable_ThrowsAuthenticationException()
         public void TryConnect_QuickConnectUnavailable_ThrowsAuthenticationException()
-            => Assert.Throws<AuthenticationException>(() => _quickConnectManager.TryConnect(_quickConnectAuthInfo));
+        {
+            _config.QuickConnectAvailable = false;
+            Assert.Throws<AuthenticationException>(() => _quickConnectManager.TryConnect(_quickConnectAuthInfo));
+        }
 
 
         [Fact]
         [Fact]
         public void CheckRequestStatus_QuickConnectUnavailable_ThrowsAuthenticationException()
         public void CheckRequestStatus_QuickConnectUnavailable_ThrowsAuthenticationException()
-            => Assert.Throws<AuthenticationException>(() => _quickConnectManager.CheckRequestStatus(string.Empty));
+        {
+            _config.QuickConnectAvailable = false;
+            Assert.Throws<AuthenticationException>(() => _quickConnectManager.CheckRequestStatus(string.Empty));
+        }
 
 
         [Fact]
         [Fact]
         public void AuthorizeRequest_QuickConnectUnavailable_ThrowsAuthenticationException()
         public void AuthorizeRequest_QuickConnectUnavailable_ThrowsAuthenticationException()
-            => Assert.ThrowsAsync<AuthenticationException>(() => _quickConnectManager.AuthorizeRequest(Guid.Empty, string.Empty));
+        {
+            _config.QuickConnectAvailable = false;
+            Assert.ThrowsAsync<AuthenticationException>(() => _quickConnectManager.AuthorizeRequest(Guid.Empty, string.Empty));
+        }
 
 
         [Fact]
         [Fact]
         public void GetAuthorizedRequest_QuickConnectUnavailable_ThrowsAuthenticationException()
         public void GetAuthorizedRequest_QuickConnectUnavailable_ThrowsAuthenticationException()
-            => Assert.Throws<AuthenticationException>(() => _quickConnectManager.GetAuthorizedRequest(string.Empty));
+        {
+            _config.QuickConnectAvailable = false;
+            Assert.Throws<AuthenticationException>(() => _quickConnectManager.GetAuthorizedRequest(string.Empty));
+        }
 
 
         [Fact]
         [Fact]
         public void IsEnabled_QuickConnectAvailable_True()
         public void IsEnabled_QuickConnectAvailable_True()