Complete management API and CLI command parity
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
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());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user