Skip to content

Commit 9f8e216

Browse files
Add additional command parser tests
1 parent a411d0e commit 9f8e216

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/ImageSharp.Web.Tests/Commands/CommandParserTests.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,22 @@ public class CommandParserTests
9595
[MemberData(nameof(IntegralLists))]
9696
[MemberData(nameof(RealLists))]
9797
[MemberData(nameof(ColorValues))]
98-
public void CommandParses<T>(T expected, string param)
98+
public void CommandParserCanConvert<T>(T expected, string param)
9999
{
100100
T sb = Parser.ParseValue<T>(param, CultureInfo.InvariantCulture);
101101
Assert.IsType<T>(sb);
102102
Assert.Equal(expected, sb);
103103
}
104104

105+
[Fact]
106+
public void CommandParseThrowsCorrectly()
107+
{
108+
var emptyParser = new CommandParser(Array.Empty<ICommandConverter>());
109+
110+
Assert.Throws<NotSupportedException>(
111+
() => emptyParser.ParseValue<bool>("true", CultureInfo.InvariantCulture));
112+
}
113+
105114
private static CommandParser GetCommandParser()
106115
{
107116
var commands = new List<ICommandConverter>

0 commit comments

Comments
 (0)