private static HelpTextSource CreateHelpTextSource(IReadOnlyList <Type> availableCommandTypes, Type targetCommandType) { var commandSchemaResolver = new CommandSchemaResolver(new CommandArgumentSchemasValidator()); var applicationMetadata = new ApplicationMetadata("TestApp", "testapp", "1.0", null); var availableCommandSchemas = commandSchemaResolver.GetCommandSchemas(availableCommandTypes); var targetCommandSchema = availableCommandSchemas.Single(s => s.Type == targetCommandType); return(new HelpTextSource(applicationMetadata, availableCommandSchemas, targetCommandSchema)); }
public void GetCommandSchemas_Test(IReadOnlyList <Type> commandTypes, IReadOnlyList <CommandSchema> expectedCommandSchemas) { // Arrange var commandSchemaResolver = new CommandSchemaResolver(new CommandArgumentSchemasValidator()); // Act var commandSchemas = commandSchemaResolver.GetCommandSchemas(commandTypes); // Assert commandSchemas.Should().BeEquivalentTo(expectedCommandSchemas); }