39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
using System;
|
|
using StellaOps.Plugin.Hosting;
|
|
using Xunit;
|
|
|
|
namespace StellaOps.Plugin.Tests;
|
|
|
|
public sealed partial class PluginHostOptionsTests
|
|
{
|
|
[Trait("Category", "Unit")]
|
|
[Fact]
|
|
public void HostVersion_CanBeConfigured()
|
|
{
|
|
var options = new PluginHostOptions();
|
|
|
|
options.HostVersion = new Version(2, 1, 0);
|
|
|
|
Assert.NotNull(options.HostVersion);
|
|
Assert.Equal(2, options.HostVersion.Major);
|
|
Assert.Equal(1, options.HostVersion.Minor);
|
|
Assert.Equal(0, options.HostVersion.Build);
|
|
}
|
|
|
|
[Trait("Category", "Unit")]
|
|
[Fact]
|
|
public void VersionCompatibility_CanBeEnforced()
|
|
{
|
|
var options = new PluginHostOptions();
|
|
|
|
options.HostVersion = new Version(1, 0, 0);
|
|
options.RequireVersionAttribute = true;
|
|
options.EnforceVersionCompatibility = true;
|
|
options.StrictMajorVersionCheck = true;
|
|
|
|
Assert.True(options.RequireVersionAttribute);
|
|
Assert.True(options.EnforceVersionCompatibility);
|
|
Assert.True(options.StrictMajorVersionCheck);
|
|
}
|
|
}
|