mirror of
https://github.com/Tyrrrz/CliFx.git
synced 2025-10-25 15:19:17 +00:00
Improve coverage for CommandOptionInputConverter
This commit is contained in:
@@ -89,18 +89,78 @@ namespace CliFx.Tests
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
yield return new TestCaseData(
|
||||||
|
new CommandOptionInput("option", "a"),
|
||||||
|
typeof(char),
|
||||||
|
'a'
|
||||||
|
);
|
||||||
|
|
||||||
|
yield return new TestCaseData(
|
||||||
|
new CommandOptionInput("option", "15"),
|
||||||
|
typeof(sbyte),
|
||||||
|
(sbyte) 15
|
||||||
|
);
|
||||||
|
|
||||||
|
yield return new TestCaseData(
|
||||||
|
new CommandOptionInput("option", "15"),
|
||||||
|
typeof(byte),
|
||||||
|
(byte) 15
|
||||||
|
);
|
||||||
|
|
||||||
|
yield return new TestCaseData(
|
||||||
|
new CommandOptionInput("option", "15"),
|
||||||
|
typeof(short),
|
||||||
|
(short) 15
|
||||||
|
);
|
||||||
|
|
||||||
|
yield return new TestCaseData(
|
||||||
|
new CommandOptionInput("option", "15"),
|
||||||
|
typeof(ushort),
|
||||||
|
(ushort) 15
|
||||||
|
);
|
||||||
|
|
||||||
yield return new TestCaseData(
|
yield return new TestCaseData(
|
||||||
new CommandOptionInput("option", "123"),
|
new CommandOptionInput("option", "123"),
|
||||||
typeof(int),
|
typeof(int),
|
||||||
123
|
123
|
||||||
);
|
);
|
||||||
|
|
||||||
|
yield return new TestCaseData(
|
||||||
|
new CommandOptionInput("option", "123"),
|
||||||
|
typeof(uint),
|
||||||
|
123u
|
||||||
|
);
|
||||||
|
|
||||||
|
yield return new TestCaseData(
|
||||||
|
new CommandOptionInput("option", "123"),
|
||||||
|
typeof(long),
|
||||||
|
123L
|
||||||
|
);
|
||||||
|
|
||||||
|
yield return new TestCaseData(
|
||||||
|
new CommandOptionInput("option", "123"),
|
||||||
|
typeof(ulong),
|
||||||
|
123UL
|
||||||
|
);
|
||||||
|
|
||||||
|
yield return new TestCaseData(
|
||||||
|
new CommandOptionInput("option", "123.45"),
|
||||||
|
typeof(float),
|
||||||
|
123.45f
|
||||||
|
);
|
||||||
|
|
||||||
yield return new TestCaseData(
|
yield return new TestCaseData(
|
||||||
new CommandOptionInput("option", "123.45"),
|
new CommandOptionInput("option", "123.45"),
|
||||||
typeof(double),
|
typeof(double),
|
||||||
123.45
|
123.45
|
||||||
);
|
);
|
||||||
|
|
||||||
|
yield return new TestCaseData(
|
||||||
|
new CommandOptionInput("option", "123.45"),
|
||||||
|
typeof(decimal),
|
||||||
|
123.45m
|
||||||
|
);
|
||||||
|
|
||||||
yield return new TestCaseData(
|
yield return new TestCaseData(
|
||||||
new CommandOptionInput("option", "28 Apr 1995"),
|
new CommandOptionInput("option", "28 Apr 1995"),
|
||||||
typeof(DateTime),
|
typeof(DateTime),
|
||||||
|
|||||||
Reference in New Issue
Block a user