21 lines
833 B
C#
21 lines
833 B
C#
using System.CommandLine;
|
|
using ZB.MOM.WW.ScadaBridge.CLI.Commands;
|
|
|
|
namespace ZB.MOM.WW.ScadaBridge.CLI.Tests;
|
|
|
|
public class ProductionRootTests
|
|
{
|
|
[Fact]
|
|
public void ProductionRoot_ExposesSchemaLibraryAndSecuredWriteLifecycle()
|
|
{
|
|
var rootType = typeof(SecuredWriteCommands).Assembly.GetType("ZB.MOM.WW.ScadaBridge.CLI.CliApplication");
|
|
Assert.NotNull(rootType);
|
|
var method = rootType.GetMethod("BuildRoot");
|
|
Assert.NotNull(method);
|
|
var root = Assert.IsType<RootCommand>(method.Invoke(null, null));
|
|
Assert.Contains(root.Subcommands, c => c.Name == "shared-schema");
|
|
var secured = root.Subcommands.Single(c => c.Name == "secured-write");
|
|
Assert.Equal(new[] { "approve", "list", "reject", "submit" }, secured.Subcommands.Select(c => c.Name).Order());
|
|
}
|
|
}
|