SEBWIN-449: Fixed pack scheme registration for unit tests.

This commit is contained in:
Damian Büchel 2021-03-18 23:41:00 +01:00
parent 48f9344164
commit 4d4e2bf5f1
4 changed files with 19 additions and 0 deletions

View file

@ -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<AppConfig>();
text = new Mock<IText>();
uiFactory = new Mock<IUserInterfaceFactory>();
// Ensure that the pack scheme is known before executing the unit tests, see https://stackoverflow.com/a/6005606
_ = PackUriHelper.UriSchemePack;
}
[TestMethod]

View file

@ -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<ILogger>();
text = new Mock<IText>();
uiFactory = new Mock<IUserInterfaceFactory>();
// Ensure that the pack scheme is known before executing the unit tests, see https://stackoverflow.com/a/6005606
_ = PackUriHelper.UriSchemePack;
}
[TestMethod]

View file

@ -71,6 +71,14 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.IO.FileSystem.Primitives, Version=4.0.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll</HintPath>
<Private>True</Private>
<Private>True</Private>
</Reference>
<Reference Include="System.IO.Packaging, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Packaging.5.0.0\lib\net46\System.IO.Packaging.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
@ -80,6 +88,7 @@
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="Operations\ApplicationOperationTests.cs" />

View file

@ -4,6 +4,8 @@
<package id="Moq" version="4.16.0" targetFramework="net472" />
<package id="MSTest.TestAdapter" version="2.1.2" targetFramework="net472" />
<package id="MSTest.TestFramework" version="2.1.2" targetFramework="net472" />
<package id="System.IO.FileSystem.Primitives" version="4.3.0" targetFramework="net472" />
<package id="System.IO.Packaging" version="5.0.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net472" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net472" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net472" />