Merge branch 'release-5.0' #33
Annotations
10 errors
XO.Console.Cli.Generators.AssemblyCommandAppDefaultsGeneratorTest.GeneratesDescriptionFromDescriptionAttribute
VerifyException : Directory: /home/runner/work/XO.Console.Cli/XO.Console.Cli/XO.Console.Cli.Analyzers.Tests/Generators
NotEqual:
- Received: AssemblyCommandAppDefaultsGeneratorTest.GeneratesDescriptionFromDescriptionAttribute#AssemblyCommandAppDefaults.g.received.cs
Verified: AssemblyCommandAppDefaultsGeneratorTest.GeneratesDescriptionFromDescriptionAttribute#AssemblyCommandAppDefaults.g.verified.cs
FileContent:
NotEqual:
Received: AssemblyCommandAppDefaultsGeneratorTest.GeneratesDescriptionFromDescriptionAttribute#AssemblyCommandAppDefaults.g.received.cs
//HintName: AssemblyCommandAppDefaults.g.cs
// <auto-generated/>
using XO.Console.Cli.Infrastructure;
#nullable enable
namespace XO.Console.Cli.Generated;
/// <summary>
/// This class was auto-generated to support the <c>XO.Console.Cli</c> infrastructure. It is not intended to be used directly from your code.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("XO.Console.Cli.Analyzers", "5.1.0.0")]
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
internal static class AssemblyCommandAppDefaults
{
[global::System.Runtime.CompilerServices.ModuleInitializerAttribute]
public static void Initialize()
{
var entryAssembly = global::System.Reflection.Assembly.GetEntryAssembly();
var executingAssembly = global::System.Reflection.Assembly.GetExecutingAssembly();
if (executingAssembly == entryAssembly)
{
TypeRegistry.SetEntryAssemblyProperties(
assemblyName: "Test",
assemblyDescription: "A test assembly",
assemblyVersion: "0.0.0.0");
}
}
}
Verified: AssemblyCommandAppDefaultsGeneratorTest.GeneratesDescriptionFromDescriptionAttribute#AssemblyCommandAppDefaults.g.verified.cs
//HintName: AssemblyCommandAppDefaults.g.cs
// <auto-generated/>
using XO.Console.Cli.Infrastructure;
#nullable enable
namespace XO.Console.Cli.Generated;
/// <summary>
/// This class was auto-generated to support the <c>XO.Console.Cli</c> infrastructure. It is not intended to be used directly from your code.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("XO.Console.Cli.Analyzers", "5.0.0.0")]
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
internal static class AssemblyCommandAppDefaults
{
[global::System.Runtime.CompilerServices.ModuleInitializerAttribute]
public static void Initialize()
{
var entryAssembly = global::System.Reflection.Assembly.GetEntryAssembly();
var executingAssembly = global::System.Reflection.Assembly.GetExecutingAssembly();
if (executingAssembly == entryAssembly)
{
TypeRegistry.SetEntryAssemblyProperties(
assemblyName: "Test",
assemblyDescription: "A test assembly",
assemblyVersion: "0.0.0.0");
}
}
}
|
XO.Console.Cli.Generators.AssemblyCommandAppDefaultsGeneratorTest.Generates
VerifyException : Directory: /home/runner/work/XO.Console.Cli/XO.Console.Cli/XO.Console.Cli.Analyzers.Tests/Generators
NotEqual:
- Received: AssemblyCommandAppDefaultsGeneratorTest.Generates#AssemblyCommandAppDefaults.g.received.cs
Verified: AssemblyCommandAppDefaultsGeneratorTest.Generates#AssemblyCommandAppDefaults.g.verified.cs
FileContent:
NotEqual:
Received: AssemblyCommandAppDefaultsGeneratorTest.Generates#AssemblyCommandAppDefaults.g.received.cs
//HintName: AssemblyCommandAppDefaults.g.cs
// <auto-generated/>
using XO.Console.Cli.Infrastructure;
#nullable enable
namespace XO.Console.Cli.Generated;
/// <summary>
/// This class was auto-generated to support the <c>XO.Console.Cli</c> infrastructure. It is not intended to be used directly from your code.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("XO.Console.Cli.Analyzers", "5.1.0.0")]
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
internal static class AssemblyCommandAppDefaults
{
[global::System.Runtime.CompilerServices.ModuleInitializerAttribute]
public static void Initialize()
{
var entryAssembly = global::System.Reflection.Assembly.GetEntryAssembly();
var executingAssembly = global::System.Reflection.Assembly.GetExecutingAssembly();
if (executingAssembly == entryAssembly)
{
TypeRegistry.SetEntryAssemblyProperties(
assemblyName: "Test",
assemblyDescription: null,
assemblyVersion: "0.0.0.0");
}
}
}
Verified: AssemblyCommandAppDefaultsGeneratorTest.Generates#AssemblyCommandAppDefaults.g.verified.cs
//HintName: AssemblyCommandAppDefaults.g.cs
// <auto-generated/>
using XO.Console.Cli.Infrastructure;
#nullable enable
namespace XO.Console.Cli.Generated;
/// <summary>
/// This class was auto-generated to support the <c>XO.Console.Cli</c> infrastructure. It is not intended to be used directly from your code.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("XO.Console.Cli.Analyzers", "5.0.0.0")]
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
internal static class AssemblyCommandAppDefaults
{
[global::System.Runtime.CompilerServices.ModuleInitializerAttribute]
public static void Initialize()
{
var entryAssembly = global::System.Reflection.Assembly.GetEntryAssembly();
var executingAssembly = global::System.Reflection.Assembly.GetExecutingAssembly();
if (executingAssembly == entryAssembly)
{
TypeRegistry.SetEntryAssemblyProperties(
assemblyName: "Test",
assemblyDescription: null,
assemblyVersion: "0.0.0.0");
}
}
}
|
XO.Console.Cli.Generators.AssemblyCommandAppDefaultsGeneratorTest.GeneratesVersionFromVersionAttribute
VerifyException : Directory: /home/runner/work/XO.Console.Cli/XO.Console.Cli/XO.Console.Cli.Analyzers.Tests/Generators
NotEqual:
- Received: AssemblyCommandAppDefaultsGeneratorTest.GeneratesVersionFromVersionAttribute#AssemblyCommandAppDefaults.g.received.cs
Verified: AssemblyCommandAppDefaultsGeneratorTest.GeneratesVersionFromVersionAttribute#AssemblyCommandAppDefaults.g.verified.cs
FileContent:
NotEqual:
Received: AssemblyCommandAppDefaultsGeneratorTest.GeneratesVersionFromVersionAttribute#AssemblyCommandAppDefaults.g.received.cs
//HintName: AssemblyCommandAppDefaults.g.cs
// <auto-generated/>
using XO.Console.Cli.Infrastructure;
#nullable enable
namespace XO.Console.Cli.Generated;
/// <summary>
/// This class was auto-generated to support the <c>XO.Console.Cli</c> infrastructure. It is not intended to be used directly from your code.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("XO.Console.Cli.Analyzers", "5.1.0.0")]
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
internal static class AssemblyCommandAppDefaults
{
[global::System.Runtime.CompilerServices.ModuleInitializerAttribute]
public static void Initialize()
{
var entryAssembly = global::System.Reflection.Assembly.GetEntryAssembly();
var executingAssembly = global::System.Reflection.Assembly.GetExecutingAssembly();
if (executingAssembly == entryAssembly)
{
TypeRegistry.SetEntryAssemblyProperties(
assemblyName: "Test",
assemblyDescription: null,
assemblyVersion: "1.2.3");
}
}
}
Verified: AssemblyCommandAppDefaultsGeneratorTest.GeneratesVersionFromVersionAttribute#AssemblyCommandAppDefaults.g.verified.cs
//HintName: AssemblyCommandAppDefaults.g.cs
// <auto-generated/>
using XO.Console.Cli.Infrastructure;
#nullable enable
namespace XO.Console.Cli.Generated;
/// <summary>
/// This class was auto-generated to support the <c>XO.Console.Cli</c> infrastructure. It is not intended to be used directly from your code.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("XO.Console.Cli.Analyzers", "5.0.0.0")]
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
internal static class AssemblyCommandAppDefaults
{
[global::System.Runtime.CompilerServices.ModuleInitializerAttribute]
public static void Initialize()
{
var entryAssembly = global::System.Reflection.Assembly.GetEntryAssembly();
var executingAssembly = global::System.Reflection.Assembly.GetExecutingAssembly();
if (executingAssembly == entryAssembly)
{
TypeRegistry.SetEntryAssemblyProperties(
assemblyName: "Test",
assemblyDescription: null,
assemblyVersion: "1.2.3");
}
}
}
|
XO.Console.Cli.Generators.CommandParametersFactoryGeneratorTest.DetectsOption
VerifyException : Directory: /home/runner/work/XO.Console.Cli/XO.Console.Cli/XO.Console.Cli.Analyzers.Tests/Generators
NotEqual:
- Received: CommandParametersFactoryGeneratorTest.DetectsOption#CommandParametersFactory.g.received.cs
Verified: CommandParametersFactoryGeneratorTest.DetectsOption#CommandParametersFactory.g.verified.cs
FileContent:
NotEqual:
Received: CommandParametersFactoryGeneratorTest.DetectsOption#CommandParametersFactory.g.received.cs
//HintName: CommandParametersFactory.g.cs
// <auto-generated/>
using XO.Console.Cli.Infrastructure;
using XO.Console.Cli.Model;
#nullable enable
namespace XO.Console.Cli.Generated;
/// <summary>
/// This class was auto-generated to support the <c>XO.Console.Cli</c> infrastructure. It is not intended to be used directly from your code.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("XO.Console.Cli.Analyzers", "5.1.0.0")]
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
internal sealed class CommandParametersFactory : ICommandParametersFactory
{
#pragma warning disable CS0436 // Type conflicts with imported type
public static readonly CommandParametersFactory Instance = new CommandParametersFactory();
#pragma warning restore CS0436 // Type conflicts with imported type
public CommandParametersInfo? DescribeParameters(global::System.Type parametersType)
{
if (parametersType is null)
throw new global::System.ArgumentNullException(nameof(parametersType));
if (parametersType == typeof(Test.Parameters))
{
return new CommandParametersInfo(
global::System.Collections.Immutable.ImmutableArray<CommandArgument>.Empty,
global::System.Collections.Immutable.ImmutableArray.Create<CommandOption>(
new CommandOption(
"Test.Parameters.Enable",
"--option",
static (context, values, converters) => ((Test.Parameters)context.Parameters).Enable = ParameterValueConverter.ConvertSingle<System.Boolean>(values, converters, static (value) => System.Boolean.Parse(value)),
typeof(System.Boolean),
null)
{
Aliases = global::System.Collections.Immutable.ImmutableArray.Create<string>(),
IsFlag = true,
IsHidden = false,
}));
}
return null;
}
[global::System.Runtime.CompilerServices.ModuleInitializerAttribute]
internal static void Register()
{
TypeRegistry.RegisterCommandParametersFactory(Instance);
}
}
Verified: CommandParametersFactoryGeneratorTest.DetectsOption#CommandParametersFactory.g.verified.cs
//HintName: CommandParametersFactory.g.cs
// <auto-generated/>
using XO.Console.Cli.Infrastructure;
using XO.Console.Cli.Model;
#nullable enable
namespace XO.Console.Cli.Generated;
/// <summary>
/// This class was auto-generated to support the <c>XO.Console.Cli</c> infrastructure. It is not intended to be used directly from your code.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("XO.Console.Cli.Analyzers", "5.0.0.0")]
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
internal sealed class CommandParametersFactory : ICommandParametersFactory
{
#pragma warning disable CS0436 // Type conflicts with imported type
public static readonly CommandParametersFactory Instance = new CommandParametersFactory();
#pragma warning restore CS0436 // Type conflicts with imported type
public CommandParametersInfo? DescribeParameters(global::System.Type parametersType)
{
if (parametersType is null)
throw new global::System.ArgumentNullException(nameof(parametersType));
if (parametersType == typeof(Test.Parameters))
{
return new CommandParametersInfo(
global::System.Collections.Imm
|
XO.Console.Cli.Generators.CommandBuilderFactoryGeneratorTest.GeneratesFactoryForCommandDeclaration_WithBranchAttributeNested
VerifyException : Directory: /home/runner/work/XO.Console.Cli/XO.Console.Cli/XO.Console.Cli.Analyzers.Tests/Generators
NotEqual:
- Received: CommandBuilderFactoryGeneratorTest.GeneratesFactoryForCommandDeclaration_WithBranchAttributeNested#CommandBuilderFactory.g.received.cs
Verified: CommandBuilderFactoryGeneratorTest.GeneratesFactoryForCommandDeclaration_WithBranchAttributeNested#CommandBuilderFactory.g.verified.cs
FileContent:
NotEqual:
Received: CommandBuilderFactoryGeneratorTest.GeneratesFactoryForCommandDeclaration_WithBranchAttributeNested#CommandBuilderFactory.g.received.cs
//HintName: CommandBuilderFactory.g.cs
// <auto-generated/>
using XO.Console.Cli.Infrastructure;
#nullable enable
namespace XO.Console.Cli.Generated;
/// <summary>
/// This class was auto-generated to support the <c>XO.Console.Cli</c> infrastructure. It is not intended to be used directly from your code.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("XO.Console.Cli.Analyzers", "5.1.0.0")]
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
internal sealed class CommandBuilderFactory : ICommandBuilderFactory
{
#pragma warning disable CS0436 // Type conflicts with imported type
public static readonly CommandBuilderFactory Instance = new CommandBuilderFactory();
#pragma warning restore CS0436 // Type conflicts with imported type
/// <inheritdoc/>
public void AddCommandAttributeCommands(CommandBuilder builder)
{
var commands1 = global::System.Collections.Immutable.ImmutableList.CreateBuilder<ConfiguredCommand>();
var commands2 = global::System.Collections.Immutable.ImmutableList.CreateBuilder<ConfiguredCommand>();
commands1.Clear();
commands2.Clear();
commands2.Add(
new ConfiguredCommand("command", static (resolver) => resolver.Get<Test.Command3>(), typeof(XO.Console.Cli.CommandParameters)));
commands1.Add(
new ConfiguredCommand("get", static (_) => new MissingCommand(), typeof(CommandParameters))
{
Commands = commands2.ToImmutable(),
});
commands2.Clear();
commands2.Add(
new ConfiguredCommand("command1", static (resolver) => resolver.Get<Test.Command1>(), typeof(XO.Console.Cli.CommandParameters))
{
Aliases = global::System.Collections.Immutable.ImmutableHashSet.Create("command"),
Description = "Does something?",
});
commands2.Add(
new ConfiguredCommand("command2", static (resolver) => resolver.Get<Test.Command2>(), typeof(XO.Console.Cli.CommandParameters))
{
Description = "Does something else?",
});
commands1.Add(
new ConfiguredCommand("load", static (_) => new MissingCommand(), typeof(CommandParameters))
{
Commands = commands2.ToImmutable(),
});
builder.AddCommand(
new ConfiguredCommand("group", static (_) => new MissingCommand(), typeof(CommandParameters))
{
Commands = commands1.ToImmutable(),
});
}
/// <inheritdoc/>
public CommandBuilder? CreateCommandBuilder<TCommand>(string verb)
where TCommand : class, ICommand
{
if (typeof(TCommand) == typeof(Test.Command1))
{
return new CommandBuilder(
verb,
static (resolver) => resolver.Get<Test.Command1>(),
typeof(XO.Console.Cli.CommandParameters));
}
if (typeof(TCommand) == typeof(Test.Command2))
{
return new CommandBuilder(
verb,
static (resolver) => resolver.Get<Test.Command2>(),
typeof(XO.Console.Cli.CommandParameters));
}
if (typeof(TCommand) == typeof(Test.Command3))
{
return new CommandBuilder(
verb,
static (resolver) => resolver.Get<Test.Command3>(),
|
XO.Console.Cli.Generators.CommandParametersFactoryGeneratorTest.DetectsNested
VerifyException : Directory: /home/runner/work/XO.Console.Cli/XO.Console.Cli/XO.Console.Cli.Analyzers.Tests/Generators
NotEqual:
- Received: CommandParametersFactoryGeneratorTest.DetectsNested#CommandParametersFactory.g.received.cs
Verified: CommandParametersFactoryGeneratorTest.DetectsNested#CommandParametersFactory.g.verified.cs
FileContent:
NotEqual:
Received: CommandParametersFactoryGeneratorTest.DetectsNested#CommandParametersFactory.g.received.cs
//HintName: CommandParametersFactory.g.cs
// <auto-generated/>
using XO.Console.Cli.Infrastructure;
using XO.Console.Cli.Model;
#nullable enable
namespace XO.Console.Cli.Generated;
/// <summary>
/// This class was auto-generated to support the <c>XO.Console.Cli</c> infrastructure. It is not intended to be used directly from your code.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("XO.Console.Cli.Analyzers", "5.1.0.0")]
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
internal sealed class CommandParametersFactory : ICommandParametersFactory
{
#pragma warning disable CS0436 // Type conflicts with imported type
public static readonly CommandParametersFactory Instance = new CommandParametersFactory();
#pragma warning restore CS0436 // Type conflicts with imported type
public CommandParametersInfo? DescribeParameters(global::System.Type parametersType)
{
if (parametersType is null)
throw new global::System.ArgumentNullException(nameof(parametersType));
if (parametersType == typeof(Test.Wrapper.Parameters))
{
return new CommandParametersInfo(
global::System.Collections.Immutable.ImmutableArray.Create<CommandArgument>(
new CommandArgument(
"Test.Wrapper.Parameters.Name",
"name",
static (context, values, converters) => ((Test.Wrapper.Parameters)context.Parameters).Name = ParameterValueConverter.ConvertSingle<System.String>(values, converters, static (value) => value),
typeof(System.String),
null)
{
Order = 1,
IsGreedy = false,
IsOptional = false,
}),
global::System.Collections.Immutable.ImmutableArray<CommandOption>.Empty);
}
return null;
}
[global::System.Runtime.CompilerServices.ModuleInitializerAttribute]
internal static void Register()
{
TypeRegistry.RegisterCommandParametersFactory(Instance);
}
}
Verified: CommandParametersFactoryGeneratorTest.DetectsNested#CommandParametersFactory.g.verified.cs
//HintName: CommandParametersFactory.g.cs
// <auto-generated/>
using XO.Console.Cli.Infrastructure;
using XO.Console.Cli.Model;
#nullable enable
namespace XO.Console.Cli.Generated;
/// <summary>
/// This class was auto-generated to support the <c>XO.Console.Cli</c> infrastructure. It is not intended to be used directly from your code.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("XO.Console.Cli.Analyzers", "5.0.0.0")]
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
internal sealed class CommandParametersFactory : ICommandParametersFactory
{
#pragma warning disable CS0436 // Type conflicts with imported type
public static readonly CommandParametersFactory Instance = new CommandParametersFactory();
#pragma warning restore CS0436 // Type conflicts with imported type
public CommandParametersInfo? DescribeParameters(global::System.Type parametersType)
{
if (parametersType is null)
throw new global::System.ArgumentNullException(nameof(parametersType));
if (parametersType == typeof(Test.Wrapper.Parameters))
{
return new CommandParametersInfo(
global::System.Collections.Immutable.ImmutableArray.Create<CommandArgument>(
|
XO.Console.Cli.Generators.CommandParametersFactoryGeneratorTest.IgnoresArgument_WhenNameIsNull
VerifyException : Directory: /home/runner/work/XO.Console.Cli/XO.Console.Cli/XO.Console.Cli.Analyzers.Tests/Generators
NotEqual:
- Received: CommandParametersFactoryGeneratorTest.IgnoresArgument_WhenNameIsNull#CommandParametersFactory.g.received.cs
Verified: CommandParametersFactoryGeneratorTest.IgnoresArgument_WhenNameIsNull#CommandParametersFactory.g.verified.cs
FileContent:
NotEqual:
Received: CommandParametersFactoryGeneratorTest.IgnoresArgument_WhenNameIsNull#CommandParametersFactory.g.received.cs
//HintName: CommandParametersFactory.g.cs
// <auto-generated/>
using XO.Console.Cli.Infrastructure;
using XO.Console.Cli.Model;
#nullable enable
namespace XO.Console.Cli.Generated;
/// <summary>
/// This class was auto-generated to support the <c>XO.Console.Cli</c> infrastructure. It is not intended to be used directly from your code.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("XO.Console.Cli.Analyzers", "5.1.0.0")]
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
internal sealed class CommandParametersFactory : ICommandParametersFactory
{
#pragma warning disable CS0436 // Type conflicts with imported type
public static readonly CommandParametersFactory Instance = new CommandParametersFactory();
#pragma warning restore CS0436 // Type conflicts with imported type
public CommandParametersInfo? DescribeParameters(global::System.Type parametersType)
{
if (parametersType is null)
throw new global::System.ArgumentNullException(nameof(parametersType));
if (parametersType == typeof(Test.Parameters))
{
return new CommandParametersInfo(
global::System.Collections.Immutable.ImmutableArray<CommandArgument>.Empty,
global::System.Collections.Immutable.ImmutableArray<CommandOption>.Empty);
}
return null;
}
[global::System.Runtime.CompilerServices.ModuleInitializerAttribute]
internal static void Register()
{
TypeRegistry.RegisterCommandParametersFactory(Instance);
}
}
Verified: CommandParametersFactoryGeneratorTest.IgnoresArgument_WhenNameIsNull#CommandParametersFactory.g.verified.cs
//HintName: CommandParametersFactory.g.cs
// <auto-generated/>
using XO.Console.Cli.Infrastructure;
using XO.Console.Cli.Model;
#nullable enable
namespace XO.Console.Cli.Generated;
/// <summary>
/// This class was auto-generated to support the <c>XO.Console.Cli</c> infrastructure. It is not intended to be used directly from your code.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("XO.Console.Cli.Analyzers", "5.0.0.0")]
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
internal sealed class CommandParametersFactory : ICommandParametersFactory
{
#pragma warning disable CS0436 // Type conflicts with imported type
public static readonly CommandParametersFactory Instance = new CommandParametersFactory();
#pragma warning restore CS0436 // Type conflicts with imported type
public CommandParametersInfo? DescribeParameters(global::System.Type parametersType)
{
if (parametersType is null)
throw new global::System.ArgumentNullException(nameof(parametersType));
if (parametersType == typeof(Test.Parameters))
{
return new CommandParametersInfo(
global::System.Collections.Immutable.ImmutableArray<CommandArgument>.Empty,
global::System.Collections.Immutable.ImmutableArray<CommandOption>.Empty);
}
return null;
}
[global::System.Runtime.CompilerServices.ModuleInitializerAttribute]
internal static void Register()
{
TypeRegistry.RegisterCommandParametersFactory(Instance);
}
}
|
XO.Console.Cli.Generators.CommandParametersFactoryGeneratorTest.DetectsArgumentWithNamedArguments
VerifyException : Directory: /home/runner/work/XO.Console.Cli/XO.Console.Cli/XO.Console.Cli.Analyzers.Tests/Generators
NotEqual:
- Received: CommandParametersFactoryGeneratorTest.DetectsArgumentWithNamedArguments#CommandParametersFactory.g.received.cs
Verified: CommandParametersFactoryGeneratorTest.DetectsArgumentWithNamedArguments#CommandParametersFactory.g.verified.cs
FileContent:
NotEqual:
Received: CommandParametersFactoryGeneratorTest.DetectsArgumentWithNamedArguments#CommandParametersFactory.g.received.cs
//HintName: CommandParametersFactory.g.cs
// <auto-generated/>
using XO.Console.Cli.Infrastructure;
using XO.Console.Cli.Model;
#nullable enable
namespace XO.Console.Cli.Generated;
/// <summary>
/// This class was auto-generated to support the <c>XO.Console.Cli</c> infrastructure. It is not intended to be used directly from your code.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("XO.Console.Cli.Analyzers", "5.1.0.0")]
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
internal sealed class CommandParametersFactory : ICommandParametersFactory
{
#pragma warning disable CS0436 // Type conflicts with imported type
public static readonly CommandParametersFactory Instance = new CommandParametersFactory();
#pragma warning restore CS0436 // Type conflicts with imported type
public CommandParametersInfo? DescribeParameters(global::System.Type parametersType)
{
if (parametersType is null)
throw new global::System.ArgumentNullException(nameof(parametersType));
if (parametersType == typeof(Test.Parameters))
{
return new CommandParametersInfo(
global::System.Collections.Immutable.ImmutableArray.Create<CommandArgument>(
new CommandArgument(
"Test.Parameters.Enable",
"arg",
static (context, values, converters) => ((Test.Parameters)context.Parameters).Enable = ParameterValueConverter.ConvertSingle<System.Boolean>(values, converters, static (value) => System.Boolean.Parse(value)),
typeof(System.Boolean),
"Enables things")
{
Order = 1,
IsGreedy = false,
IsOptional = true,
}),
global::System.Collections.Immutable.ImmutableArray<CommandOption>.Empty);
}
return null;
}
[global::System.Runtime.CompilerServices.ModuleInitializerAttribute]
internal static void Register()
{
TypeRegistry.RegisterCommandParametersFactory(Instance);
}
}
Verified: CommandParametersFactoryGeneratorTest.DetectsArgumentWithNamedArguments#CommandParametersFactory.g.verified.cs
//HintName: CommandParametersFactory.g.cs
// <auto-generated/>
using XO.Console.Cli.Infrastructure;
using XO.Console.Cli.Model;
#nullable enable
namespace XO.Console.Cli.Generated;
/// <summary>
/// This class was auto-generated to support the <c>XO.Console.Cli</c> infrastructure. It is not intended to be used directly from your code.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("XO.Console.Cli.Analyzers", "5.0.0.0")]
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
internal sealed class CommandParametersFactory : ICommandParametersFactory
{
#pragma warning disable CS0436 // Type conflicts with imported type
public static readonly CommandParametersFactory Instance = new CommandParametersFactory();
#pragma warning restore CS0436 // Type conflicts with imported type
public CommandParametersInfo? DescribeParameters(global::System.Type parametersType)
{
if (parametersType is null)
throw new global::System.ArgumentNullException(nameof(parametersType));
if (parametersType == typeof(Test.Parameters))
{
return new CommandParametersInfo(
global
|
XO.Console.Cli.Generators.CommandBuilderFactoryGeneratorTest.GeneratesFactoryForCommandDeclaration_WithMultipleInterfaces
VerifyException : Directory: /home/runner/work/XO.Console.Cli/XO.Console.Cli/XO.Console.Cli.Analyzers.Tests/Generators
NotEqual:
- Received: CommandBuilderFactoryGeneratorTest.GeneratesFactoryForCommandDeclaration_WithMultipleInterfaces#CommandBuilderFactory.g.received.cs
Verified: CommandBuilderFactoryGeneratorTest.GeneratesFactoryForCommandDeclaration_WithMultipleInterfaces#CommandBuilderFactory.g.verified.cs
FileContent:
NotEqual:
Received: CommandBuilderFactoryGeneratorTest.GeneratesFactoryForCommandDeclaration_WithMultipleInterfaces#CommandBuilderFactory.g.received.cs
//HintName: CommandBuilderFactory.g.cs
// <auto-generated/>
using XO.Console.Cli.Infrastructure;
#nullable enable
namespace XO.Console.Cli.Generated;
/// <summary>
/// This class was auto-generated to support the <c>XO.Console.Cli</c> infrastructure. It is not intended to be used directly from your code.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("XO.Console.Cli.Analyzers", "5.1.0.0")]
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
internal sealed class CommandBuilderFactory : ICommandBuilderFactory
{
#pragma warning disable CS0436 // Type conflicts with imported type
public static readonly CommandBuilderFactory Instance = new CommandBuilderFactory();
#pragma warning restore CS0436 // Type conflicts with imported type
/// <inheritdoc/>
public void AddCommandAttributeCommands(CommandBuilder builder)
{
}
/// <inheritdoc/>
public CommandBuilder? CreateCommandBuilder<TCommand>(string verb)
where TCommand : class, ICommand
{
if (typeof(TCommand) == typeof(Test.Command1))
{
return new CommandBuilder(
verb,
static (resolver) => resolver.Get<Test.Command1>(),
typeof(XO.Console.Cli.CommandParameters));
}
return null;
}
[global::System.Runtime.CompilerServices.ModuleInitializerAttribute]
internal static void Register()
{
TypeRegistry.RegisterCommandBuilderFactory(Instance);
}
}
Verified: CommandBuilderFactoryGeneratorTest.GeneratesFactoryForCommandDeclaration_WithMultipleInterfaces#CommandBuilderFactory.g.verified.cs
//HintName: CommandBuilderFactory.g.cs
// <auto-generated/>
using XO.Console.Cli.Infrastructure;
#nullable enable
namespace XO.Console.Cli.Generated;
/// <summary>
/// This class was auto-generated to support the <c>XO.Console.Cli</c> infrastructure. It is not intended to be used directly from your code.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("XO.Console.Cli.Analyzers", "5.0.0.0")]
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
internal sealed class CommandBuilderFactory : ICommandBuilderFactory
{
#pragma warning disable CS0436 // Type conflicts with imported type
public static readonly CommandBuilderFactory Instance = new CommandBuilderFactory();
#pragma warning restore CS0436 // Type conflicts with imported type
/// <inheritdoc/>
public void AddCommandAttributeCommands(CommandBuilder builder)
{
}
/// <inheritdoc/>
public CommandBuilder? CreateCommandBuilder<TCommand>(string verb)
where TCommand : class, ICommand
{
if (typeof(TCommand) == typeof(Test.Command1))
{
return new CommandBuilder(
verb,
static (resolver) => resolver.Get<Test.Command1>(),
typeof(XO.Console.Cli.CommandParameters));
}
return null;
}
[global::System.Runtime.CompilerServices.ModuleInitializerAttribute]
internal static void Register()
{
TypeRegistry.RegisterCommandBuilderFactory(Instance);
}
}
|
XO.Console.Cli.Generators.CommandParametersFactoryGeneratorTest.AssignsValuesForEachParsingStrategy
VerifyException : Directory: /home/runner/work/XO.Console.Cli/XO.Console.Cli/XO.Console.Cli.Analyzers.Tests/Generators
NotEqual:
- Received: CommandParametersFactoryGeneratorTest.AssignsValuesForEachParsingStrategy#CommandParametersFactory.g.received.cs
Verified: CommandParametersFactoryGeneratorTest.AssignsValuesForEachParsingStrategy#CommandParametersFactory.g.verified.cs
FileContent:
NotEqual:
Received: CommandParametersFactoryGeneratorTest.AssignsValuesForEachParsingStrategy#CommandParametersFactory.g.received.cs
//HintName: CommandParametersFactory.g.cs
// <auto-generated/>
using XO.Console.Cli.Infrastructure;
using XO.Console.Cli.Model;
#nullable enable
namespace XO.Console.Cli.Generated;
/// <summary>
/// This class was auto-generated to support the <c>XO.Console.Cli</c> infrastructure. It is not intended to be used directly from your code.
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("XO.Console.Cli.Analyzers", "5.1.0.0")]
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
internal sealed class CommandParametersFactory : ICommandParametersFactory
{
#pragma warning disable CS0436 // Type conflicts with imported type
public static readonly CommandParametersFactory Instance = new CommandParametersFactory();
#pragma warning restore CS0436 // Type conflicts with imported type
public CommandParametersInfo? DescribeParameters(global::System.Type parametersType)
{
if (parametersType is null)
throw new global::System.ArgumentNullException(nameof(parametersType));
if (parametersType == typeof(Test.Parameters))
{
return new CommandParametersInfo(
global::System.Collections.Immutable.ImmutableArray<CommandArgument>.Empty,
global::System.Collections.Immutable.ImmutableArray.Create<CommandOption>(
new CommandOption(
"Test.Parameters.Constructor",
"--value",
static (context, values, converters) => ((Test.Parameters)context.Parameters).Constructor = ParameterValueConverter.ConvertSingle<Test.MyType>(values, converters, static (value) => new Test.MyType(value)),
typeof(Test.MyType),
null)
{
Aliases = global::System.Collections.Immutable.ImmutableArray.Create<string>(),
IsFlag = false,
IsHidden = false,
},
new CommandOption(
"Test.Parameters.Parse",
"--count",
static (context, values, converters) => ((Test.Parameters)context.Parameters).Parse = ParameterValueConverter.ConvertSingle<System.Int32>(values, converters, static (value) => System.Int32.Parse(value)),
typeof(System.Int32),
null)
{
Aliases = global::System.Collections.Immutable.ImmutableArray.Create<string>(),
IsFlag = false,
IsHidden = false,
},
new CommandOption(
"Test.Parameters.Enum",
"--style",
static (context, values, converters) => ((Test.Parameters)context.Parameters).Enum = ParameterValueConverter.ConvertSingle<XO.Console.Cli.CommandOptionStyle>(values, converters, ParameterValueConverter.ParseEnum<XO.Console.Cli.CommandOptionStyle>),
typeof(XO.Console.Cli.CommandOptionStyle),
null)
{
Aliases = global::System.Collections.Immutable.ImmutableArray.Create<string>(),
IsFlag = false,
IsHidden = false,
},
new CommandOption(
"Test.Parameters.None",
"--command",
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
reports
Expired
|
2.37 MB |
|