spectre.console/test/Spectre.Console.Tests/Data/Settings/OptionalArgumentWithDefaultValueSettings.cs
Patrik Svensson c9b178ac96 Moved analyzer tests to its own project
Also moves tests to `./test` which makes it possible
for all test projects to share the same .editorconfig
files and similar.
2021-06-23 22:47:12 +02:00

41 lines
1.2 KiB
C#

using System;
using System.ComponentModel;
using Spectre.Console.Cli;
namespace Spectre.Console.Tests.Data
{
public sealed class OptionalArgumentWithDefaultValueSettings : CommandSettings
{
[CommandArgument(0, "[GREETING]")]
[DefaultValue("Hello World")]
public string Greeting { get; set; }
}
public sealed class OptionalArgumentWithPropertyInitializerSettings : CommandSettings
{
[CommandArgument(0, "[NAMES]")]
public string[] Names { get; set; } = Array.Empty<string>();
[CommandOption("-c")]
public int Count { get; set; } = 1;
[CommandOption("-v")]
public int Value { get; set; } = 0;
}
public sealed class OptionalArgumentWithDefaultValueAndTypeConverterSettings : CommandSettings
{
[CommandArgument(0, "[GREETING]")]
[DefaultValue("5")]
[TypeConverter(typeof(StringToIntegerConverter))]
public int Greeting { get; set; }
}
public sealed class RequiredArgumentWithDefaultValueSettings : CommandSettings
{
[CommandArgument(0, "<GREETING>")]
[DefaultValue("Hello World")]
public string Greeting { get; set; }
}
}