38 lines
951 B
C#
38 lines
951 B
C#
using System;
|
|
using System.IO;
|
|
using StellaOps.Plugin.Hosting;
|
|
using Xunit;
|
|
|
|
namespace StellaOps.Plugin.Tests;
|
|
|
|
public sealed partial class PluginHostTests
|
|
{
|
|
[Trait("Category", "Unit")]
|
|
[Fact]
|
|
public void LoadPlugins_WithPluginOrder_AcceptsOrderConfiguration()
|
|
{
|
|
var tempDir = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
|
|
Directory.CreateDirectory(tempDir);
|
|
|
|
try
|
|
{
|
|
var options = new PluginHostOptions
|
|
{
|
|
PluginsDirectory = tempDir,
|
|
EnsureDirectoryExists = false
|
|
};
|
|
options.PluginOrder.Add("PluginA");
|
|
options.PluginOrder.Add("PluginB");
|
|
|
|
var result = PluginHost.LoadPlugins(options);
|
|
|
|
Assert.Empty(result.Plugins);
|
|
Assert.NotNull(result.MissingOrderedPlugins);
|
|
}
|
|
finally
|
|
{
|
|
Directory.Delete(tempDir, true);
|
|
}
|
|
}
|
|
}
|