mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
1 parent
6ec3dc308e
commit
b820817c84
2 files changed
+27
-6
No files matched your search
@@ -0,0 +1,26 @@
|
||||
using Xunit;
|
||||
using System;
|
||||
using System.Management.Automation;
|
||||
using Microsoft.PowerShell.Linux.Host;
|
||||
|
||||
// This collection fixture initializes Core PowerShell's AssemblyLoadContext once and only
|
||||
// once. Attempting to initialize in a class level fixture will cause multiple
|
||||
// initializations, resulting in test failure due to "Binding model is already locked for
|
||||
// the AppDomain and cannot be reset".
|
||||
namespace PSTests
|
||||
{
|
||||
public class AssemblyLoadContextFixture
|
||||
{
|
||||
public AssemblyLoadContextFixture()
|
||||
{
|
||||
// Initialize the Core PowerShell AssemblyLoadContext
|
||||
PowerShellAssemblyLoadContextInitializer.SetPowerShellAssemblyLoadContext(AppContext.BaseDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
[CollectionDefinition("AssemblyLoadContext")]
|
||||
public class AssemblyLoadContextCollection : ICollectionFixture<AssemblyLoadContextFixture>
|
||||
{
|
||||
// nothing to do but satisfy the interface
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user