Skip to content

Commit 31360d3

Browse files
committed
fix broken test expectation
1 parent 84c4a9e commit 31360d3

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

tests/StackExchange.Redis.Tests/ConfigTests.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ public void ExpectedFields()
2727
{
2828
// if this test fails, check that you've updated ConfigurationOptions.Clone(), then: fix the test!
2929
// this is a simple but pragmatic "have you considered?" check
30-
var fields = Array.ConvertAll(
31-
typeof(ConfigurationOptions).GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance),
32-
x => Regex.Replace(x.Name, """^<(\w+)>k__BackingField$""", "$1"));
33-
Array.Sort(fields);
30+
var fields = (
31+
from field in typeof(ConfigurationOptions).GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
32+
let name = Regex.Replace(field.Name, """^<(\w+)>k__BackingField$""", "$1")
33+
where name is not "WriteMode" // silently ignored
34+
orderby name
35+
select name).ToArray();
3436
Assert.Equal(
3537
new[]
3638
{

0 commit comments

Comments
 (0)