public void Command_with_argument(bool useVB) { var descriptor = new CliDescriptor { CommandDescriptor = new CommandDescriptor(null, "MyCommand", new RawInfoForType(null, namespaceName, className)) }; descriptor.CommandDescriptor.Arguments.Add(new ArgumentDescriptor(new ArgTypeInfoRoslyn(typeof(string)), descriptor.CommandDescriptor, "Argument1", new RawInfoForProperty(null, namespaceName, className))); var dom = new GenerateCommandSource().CreateCode(descriptor); var actual = Utils.Generator(useVB).Generate(dom); NamerFactory.AdditionalInformation = Utils.LanguageName(useVB); Approvals.Verify(actual); }
public void Command_with_option(bool useVB) { var descriptor = new CliDescriptor { CommandDescriptor = new CommandDescriptor(null, "MyCommand", new RawInfoForType(null, namespaceName, className)) }; descriptor.CommandDescriptor.Options.Add(new OptionDescriptor(descriptor.CommandDescriptor, "Option1", new RawInfoForProperty(null, namespaceName, className))); var dom = new GenerateCommandSource().CreateCode(descriptor); var actual = Utils.Generator(useVB).Generate(dom); NamerFactory.AdditionalInformation = Utils.LanguageName(useVB); Approvals.Verify(actual); }
public void Simple_command(bool useVB) { var descriptor = new CliDescriptor { CommandDescriptor = new CommandDescriptor(null, "MyCommand", new RawInfoForType(null, namespaceName, className)) }; descriptor.CommandDescriptor.CliName = "my-command"; var dom = new GenerateCommandSource().CreateCode(descriptor); var actual = Utils.Generator(useVB).Generate(dom); NamerFactory.AdditionalInformation = Utils.LanguageName(useVB); Approvals.Verify(actual); }