Skip to content

Commit 4e3c4d8

Browse files
Add display names to all tests
1 parent f303fce commit 4e3c4d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1535
-1589
lines changed

Matchmaker.Tests/AsyncMatchExpressionBuilderTests.cs

Lines changed: 59 additions & 67 deletions
Large diffs are not rendered by default.

Matchmaker.Tests/AsyncMatchExpressionTests.cs

Lines changed: 56 additions & 66 deletions
Large diffs are not rendered by default.

Matchmaker.Tests/AsyncMatchStatementBuilderTests.cs

Lines changed: 45 additions & 53 deletions
Large diffs are not rendered by default.

Matchmaker.Tests/AsyncMatchStatementTests.cs

Lines changed: 42 additions & 52 deletions
Large diffs are not rendered by default.

Matchmaker.Tests/Linq/AsAsyncTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ namespace Matchmaker.Linq;
22

33
public class AsAsyncTests
44
{
5-
[Property]
5+
[Property(DisplayName = "AsAsync should match the same as pattern")]
66
public async Task<Property> AsAsyncShouldMatchSameAsPattern(IPattern<string, string> pattern, string x) =>
77
(pattern.Match(x) == await pattern.AsAsync().MatchAsync(x)).ToProperty();
88

@@ -13,41 +13,41 @@ public async Task<Property> AsAsyncWithDescriptionShouldMatchSameAsPattern(
1313
string x) =>
1414
(pattern.Match(x) == await pattern.AsAsync(description.Get).MatchAsync(x)).ToProperty();
1515

16-
[Property]
16+
[Property(DisplayName = "AsAsync should never return null")]
1717
public Property AsAsyncShouldNeverReturnNull(IPattern<string, string> pattern) =>
1818
(pattern.AsAsync() != null).ToProperty();
1919

20-
[Property]
20+
[Property(DisplayName = "AsAsync with description should never return null")]
2121
public Property AsAsyncWithDescriptionShouldNeverReturnNull(
2222
IPattern<string, string> pattern,
2323
NonNull<string> description) =>
2424
(pattern.AsAsync(description.Get) != null).ToProperty();
2525

26-
[Property]
26+
[Property(DisplayName = "AsAsync should have the same description as pattern")]
2727
public Property AsAsyncShouldHaveSameDescriptionAsPattern(IPattern<string, string> pattern) =>
2828
(pattern.Description == pattern.AsAsync().Description).ToProperty();
2929

30-
[Property]
30+
[Property(DisplayName = "AsAsync with description should have the specified description")]
3131
public Property AsAsyncWithDescriptionShouldHaveSpecifiedDescription(
3232
IPattern<string, string> pattern,
3333
NonNull<string> description) =>
3434
(pattern.AsAsync(description.Get).Description == description.Get).ToProperty();
3535

36-
[Fact]
36+
[Fact(DisplayName = "AsAsync should throw if pattern is null")]
3737
public void AsAsyncShouldThrowIfPatternIsNull()
3838
{
3939
var action = () => ((IPattern<string, string>)null).AsAsync();
4040
action.Should().Throw<ArgumentNullException>();
4141
}
4242

43-
[Property]
43+
[Property(DisplayName = "AsAsync with description should throw if pattern is null")]
4444
public void AsAsyncWithDescriptionShouldThrowIfPatternIsNull(NonNull<string> description)
4545
{
4646
var action = () => ((IPattern<string, string>)null).AsAsync(description.Get);
4747
action.Should().Throw<ArgumentNullException>();
4848
}
4949

50-
[Property]
50+
[Property(DisplayName = "AsAsync with description should throw if description is null")]
5151
public void AsAsyncWithDescriptionShouldThrowIfDescriptionIsNull(IPattern<string, string> pattern)
5252
{
5353
var action = () => pattern.AsAsync(null);

Matchmaker.Tests/Linq/AsyncBindTests.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ namespace Matchmaker.Linq;
22

33
public class AsyncBindTests
44
{
5-
[Property]
5+
[Property(DisplayName = "Bind pattern should never return null")]
66
public Property BindPatternShouldNeverReturnNull(
77
IAsyncPattern<string, string> pattern,
88
Func<string, IAsyncPattern<string, string>> binder) =>
99
(pattern.Bind(binder) != null).ToProperty();
1010

11-
[Property]
11+
[Property(DisplayName = "Bind pattern with description should never return null")]
1212
public Property BindPatternWithDescriptionShouldNeverReturnNull(
1313
IAsyncPattern<string, string> pattern,
1414
Func<string, IAsyncPattern<string, string>> binder,
1515
NonNull<string> description) =>
1616
(pattern.Bind(binder, description.Get) != null).ToProperty();
1717

18-
[Property]
18+
[Property(DisplayName = "Bind pattern should match the same as binder result")]
1919
public async Task<Property> BindPatternShouldMatchSameAsBinderResult(
2020
IAsyncPattern<string, string> pattern,
2121
Func<string, IAsyncPattern<string, string>> binder,
@@ -27,7 +27,7 @@ await pattern.Bind(binder).MatchAsync(x) == await binder(result.Value).MatchAsyn
2727
.ToProperty();
2828
}
2929

30-
[Property]
30+
[Property(DisplayName = "Bind pattern with description should match the same as binder result")]
3131
public async Task<Property> BindPatternWithDescriptionShouldMatchSameAsBinderResult(
3232
IAsyncPattern<string, string> pattern,
3333
Func<string, IAsyncPattern<string, string>> binder,
@@ -40,27 +40,27 @@ await pattern.Bind(binder, description.Get).MatchAsync(x) == await binder(result
4040
.ToProperty();
4141
}
4242

43-
[Property]
43+
[Property(DisplayName = "Bind pattern should have the same description as pattern")]
4444
public Property BindPatternShouldHaveSameDescriptionAsPattern(
4545
IAsyncPattern<string, string> pattern,
4646
Func<string, IAsyncPattern<string, string>> binder) =>
4747
(pattern.Bind(binder).Description == pattern.Description).ToProperty();
4848

49-
[Property]
49+
[Property(DisplayName = "Bind pattern with description should have the specified description")]
5050
public Property BindPatternWithDescriptionShouldHaveSpecifiedDescription(
5151
IAsyncPattern<string, string> pattern,
5252
Func<string, IAsyncPattern<string, string>> binder,
5353
NonNull<string> description) =>
5454
(pattern.Bind(binder, description.Get).Description == description.Get).ToProperty();
5555

56-
[Property]
56+
[Property(DisplayName = "Bind pattern should throw if pattern is null")]
5757
public void BindPatternShouldThrowIfPatternIsNull(Func<string, IAsyncPattern<string, string>> binder)
5858
{
5959
var action = () => ((IAsyncPattern<string, string>)null).Bind(binder);
6060
action.Should().Throw<ArgumentNullException>();
6161
}
6262

63-
[Property]
63+
[Property(DisplayName = "Bind pattern with description should throw if pattern is null")]
6464
public void BindPatternWithDescriptionShouldThrowIfPatternIsNull(
6565
Func<string, IAsyncPattern<string, string>> binder,
6666
NonNull<string> description)
@@ -69,14 +69,14 @@ public void BindPatternWithDescriptionShouldThrowIfPatternIsNull(
6969
action.Should().Throw<ArgumentNullException>();
7070
}
7171

72-
[Property]
72+
[Property(DisplayName = "Bind pattern should throw if binder is null")]
7373
public void BindPatternShouldThrowIfBinderIsNull(IAsyncPattern<string, string> pattern)
7474
{
7575
var action = () => pattern.Bind((Func<string, IAsyncPattern<string, int>>)null);
7676
action.Should().Throw<ArgumentNullException>();
7777
}
7878

79-
[Property]
79+
[Property(DisplayName = "Bind pattern with description should throw if description is null")]
8080
public void BindPatternWithDescriptionShouldThrowIfDescriptionIsNull(
8181
IAsyncPattern<string, string> pattern,
8282
Func<string, IAsyncPattern<string, string>> binder)

Matchmaker.Tests/Linq/AsyncCachedTests.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,29 @@ namespace Matchmaker.Linq;
22

33
public class AsyncCachedTests
44
{
5-
[Property]
5+
[Property(DisplayName = "Cached pattern should never return null")]
66
public Property CachedPatternShouldNeverReturnNull(IAsyncPattern<string, string> pattern) =>
77
(pattern.Cached() != null).ToProperty();
88

9-
[Property]
9+
[Property(DisplayName = "Cached pattern with description should never return null")]
1010
public Property CachedPatternWithDescriptionShouldNeverReturnNull(
1111
IAsyncPattern<string, string> pattern,
1212
NonNull<string> description) =>
1313
(pattern.Cached(description.Get) != null).ToProperty();
1414

15-
[Property]
15+
[Property(DisplayName = "Cached pattern should match the same as pattern")]
1616
public async Task<Property> CachedPatternShouldMatchSameAsPattern(
1717
IAsyncPattern<string, string> pattern, string x) =>
1818
(await pattern.Cached().MatchAsync(x) == await pattern.MatchAsync(x)).ToProperty();
1919

20-
[Property]
20+
[Property(DisplayName = "Cached pattern with description should match the same as pattern")]
2121
public async Task<Property> CachedPatternWithDescriptionShouldMatchSameAsPattern(
2222
IAsyncPattern<string, string> pattern,
2323
string x,
2424
NonNull<string> description) =>
2525
(await pattern.Cached(description.Get).MatchAsync(x) == await pattern.MatchAsync(x)).ToProperty();
2626

27-
[Property]
27+
[Property(DisplayName = "Cached pattern should be cached")]
2828
public async Task<Property> CachedPatternShouldBeCached(string x)
2929
{
3030
int count = 0;
@@ -41,7 +41,7 @@ public async Task<Property> CachedPatternShouldBeCached(string x)
4141
return (count == 1).ToProperty();
4242
}
4343

44-
[Property]
44+
[Property(DisplayName = "Cached pattern with description should be cached")]
4545
public async Task<Property> CachedPatternWithDescriptionShouldBeCached(string x, NonNull<string> description)
4646
{
4747
int count = 0;
@@ -58,31 +58,31 @@ public async Task<Property> CachedPatternWithDescriptionShouldBeCached(string x,
5858
return (count == 1).ToProperty();
5959
}
6060

61-
[Property]
61+
[Property(DisplayName = "Cached pattern should have the same description as pattern")]
6262
public Property CachedPatternShouldHaveSameDescriptionAsPattern(IAsyncPattern<string, string> pattern) =>
6363
(pattern.Cached().Description == pattern.Description).ToProperty();
6464

65-
[Property]
65+
[Property(DisplayName = "Cached pattern with description should have the specified description")]
6666
public Property CachedPatternWithDescriptionShouldHaveSpecifiedDescription(
6767
IAsyncPattern<string, string> pattern,
6868
NonNull<string> description) =>
6969
(pattern.Cached(description.Get).Description == description.Get).ToProperty();
7070

71-
[Fact]
71+
[Fact(DisplayName = "Cached pattern should throw if pattern is null")]
7272
public void CachedPatternShouldThrowIfPatternIsNull()
7373
{
7474
var action = () => ((IAsyncPattern<string, string>)null).Cached();
7575
action.Should().Throw<ArgumentNullException>();
7676
}
7777

78-
[Property]
78+
[Property(DisplayName = "Cached pattern with description should throw if pattern is null")]
7979
public void CachedPatternWithDescriptionShouldThrowIfPatternIsNull(NonNull<string> description)
8080
{
8181
var action = () => ((IAsyncPattern<string, string>)null).Cached(description.Get);
8282
action.Should().Throw<ArgumentNullException>();
8383
}
8484

85-
[Property]
85+
[Property(DisplayName = "Cached pattern with description should throw if description is null")]
8686
public void CachedPatternWithDescriptionShouldThrowIfDescriptionIsNull(IAsyncPattern<string, string> pattern)
8787
{
8888
var action = () => pattern.Cached(null);

0 commit comments

Comments
 (0)