From 4d4e2bf5f1249a01ff87e1ec8f4c94cc4a9472a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20B=C3=BCchel?= Date: Thu, 18 Mar 2021 23:41:00 +0100 Subject: [PATCH] SEBWIN-449: Fixed pack scheme registration for unit tests. --- .../Notifications/AboutNotificationControllerTests.cs | 4 ++++ .../Notifications/LogNotificationControllerTests.cs | 4 ++++ .../SafeExamBrowser.Client.UnitTests.csproj | 9 +++++++++ SafeExamBrowser.Client.UnitTests/packages.config | 2 ++ 4 files changed, 19 insertions(+) diff --git a/SafeExamBrowser.Client.UnitTests/Notifications/AboutNotificationControllerTests.cs b/SafeExamBrowser.Client.UnitTests/Notifications/AboutNotificationControllerTests.cs index 1abfda99..f1ad737d 100644 --- a/SafeExamBrowser.Client.UnitTests/Notifications/AboutNotificationControllerTests.cs +++ b/SafeExamBrowser.Client.UnitTests/Notifications/AboutNotificationControllerTests.cs @@ -6,6 +6,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +using System.IO.Packaging; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using SafeExamBrowser.Client.Notifications; @@ -29,6 +30,9 @@ namespace SafeExamBrowser.Client.UnitTests.Notifications appConfig = new Mock(); text = new Mock(); uiFactory = new Mock(); + + // Ensure that the pack scheme is known before executing the unit tests, see https://stackoverflow.com/a/6005606 + _ = PackUriHelper.UriSchemePack; } [TestMethod] diff --git a/SafeExamBrowser.Client.UnitTests/Notifications/LogNotificationControllerTests.cs b/SafeExamBrowser.Client.UnitTests/Notifications/LogNotificationControllerTests.cs index 4d2c382a..bec16f23 100644 --- a/SafeExamBrowser.Client.UnitTests/Notifications/LogNotificationControllerTests.cs +++ b/SafeExamBrowser.Client.UnitTests/Notifications/LogNotificationControllerTests.cs @@ -6,6 +6,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +using System.IO.Packaging; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using SafeExamBrowser.Client.Notifications; @@ -29,6 +30,9 @@ namespace SafeExamBrowser.Client.UnitTests.Notifications logger = new Mock(); text = new Mock(); uiFactory = new Mock(); + + // Ensure that the pack scheme is known before executing the unit tests, see https://stackoverflow.com/a/6005606 + _ = PackUriHelper.UriSchemePack; } [TestMethod] diff --git a/SafeExamBrowser.Client.UnitTests/SafeExamBrowser.Client.UnitTests.csproj b/SafeExamBrowser.Client.UnitTests/SafeExamBrowser.Client.UnitTests.csproj index 71509fed..11f0ebb9 100644 --- a/SafeExamBrowser.Client.UnitTests/SafeExamBrowser.Client.UnitTests.csproj +++ b/SafeExamBrowser.Client.UnitTests/SafeExamBrowser.Client.UnitTests.csproj @@ -71,6 +71,14 @@ + + ..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll + True + True + + + ..\packages\System.IO.Packaging.5.0.0\lib\net46\System.IO.Packaging.dll + ..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll @@ -80,6 +88,7 @@ ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll + diff --git a/SafeExamBrowser.Client.UnitTests/packages.config b/SafeExamBrowser.Client.UnitTests/packages.config index 8a3d95b0..e2097cad 100644 --- a/SafeExamBrowser.Client.UnitTests/packages.config +++ b/SafeExamBrowser.Client.UnitTests/packages.config @@ -4,6 +4,8 @@ + +