Skip to content

Commit 47e969c

Browse files
committed
test: move failure cases to a theory
1 parent a1cbd5c commit 47e969c

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

test/Discord.Tests.Unit/Utilities/EmoteTests.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
42
using Xunit;
53

64
namespace Discord.Tests.Unit
@@ -14,11 +12,16 @@ public void Parse()
1412
var (resultId, resultName) = EmoteUtilities.ParseGuildEmote(input);
1513
Assert.Equal(243902586946715658UL, resultId);
1614
Assert.Equal("gopher", resultName);
15+
}
1716

18-
Assert.Throws<ArgumentException>(() => EmoteUtilities.ParseGuildEmote("foo"));
19-
Assert.Throws<ArgumentException>(() => EmoteUtilities.ParseGuildEmote("<foo"));
20-
Assert.Throws<ArgumentException>(() => EmoteUtilities.ParseGuildEmote("<:foo"));
21-
Assert.Throws<ArgumentException>(() => EmoteUtilities.ParseGuildEmote("<:foo>"));
17+
[Theory]
18+
[InlineData("foo")]
19+
[InlineData("<foo")]
20+
[InlineData("<:foo")]
21+
[InlineData("<:foo>")]
22+
public void Parse_Fail(string data)
23+
{
24+
Assert.Throws<ArgumentException>(() => EmoteUtilities.ParseGuildEmote(data));
2225
}
2326

2427
[Fact]

0 commit comments

Comments
 (0)