Skip to content

Commit 309d276

Browse files
authored
naming only: IsPatternBased -> IsPattern (#2482)
(also fix some remaining debug tests)
1 parent 8abe002 commit 309d276

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

docs/ReleaseNotes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Current package versions:
88

99
## Unreleased
1010

11-
- Fix [#2479](https://github.com/StackExchange/StackExchange.Redis/issues/2479): Add `RedisChannel.UseImplicitAutoPattern` (global) and `RedisChannel.IsPatternBased` ([#2480 by mgravell](https://github.com/StackExchange/StackExchange.Redis/pull/2480))
11+
- Fix [#2479](https://github.com/StackExchange/StackExchange.Redis/issues/2479): Add `RedisChannel.UseImplicitAutoPattern` (global) and `RedisChannel.IsPattern` ([#2480 by mgravell](https://github.com/StackExchange/StackExchange.Redis/pull/2480))
1212
- Fix [#2479](https://github.com/StackExchange/StackExchange.Redis/issues/2479): Mark `RedisChannel` conversion operators as obsolete; add `RedisChannel.Literal` and `RedisChannel.Pattern` helpers ([#2481 by mgravell](https://github.com/StackExchange/StackExchange.Redis/pull/2481))
1313
- Fix [#2449](https://github.com/StackExchange/StackExchange.Redis/issues/2449): Update `Pipelines.Sockets.Unofficial` to `v2.2.8` to support native AOT ([#2456 by eerhardt](https://github.com/StackExchange/StackExchange.Redis/pull/2456))
1414

src/StackExchange.Redis/KeyspaceIsolation/KeyPrefixed.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ protected RedisValue SortGetToInner(RedisValue outer) =>
844844
protected RedisChannel ToInner(RedisChannel outer)
845845
{
846846
var combined = RedisKey.ConcatenateBytes(Prefix, null, (byte[]?)outer);
847-
return new RedisChannel(combined, outer.IsPatternBased ? RedisChannel.PatternMode.Pattern : RedisChannel.PatternMode.Literal);
847+
return new RedisChannel(combined, outer.IsPattern ? RedisChannel.PatternMode.Pattern : RedisChannel.PatternMode.Literal);
848848
}
849849

850850
private Func<RedisKey, RedisKey>? mapFunction;

src/StackExchange.Redis/PublicAPI/PublicAPI.Shipped.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,7 @@ StackExchange.Redis.Proxy.Twemproxy = 1 -> StackExchange.Redis.Proxy
12591259
StackExchange.Redis.RedisChannel
12601260
StackExchange.Redis.RedisChannel.Equals(StackExchange.Redis.RedisChannel other) -> bool
12611261
StackExchange.Redis.RedisChannel.IsNullOrEmpty.get -> bool
1262-
StackExchange.Redis.RedisChannel.IsPatternBased.get -> bool
1262+
StackExchange.Redis.RedisChannel.IsPattern.get -> bool
12631263
StackExchange.Redis.RedisChannel.PatternMode
12641264
StackExchange.Redis.RedisChannel.PatternMode.Auto = 0 -> StackExchange.Redis.RedisChannel.PatternMode
12651265
StackExchange.Redis.RedisChannel.PatternMode.Literal = 1 -> StackExchange.Redis.RedisChannel.PatternMode

src/StackExchange.Redis/RedisChannel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace StackExchange.Redis
1919
/// <summary>
2020
/// Indicates whether this channel represents a wildcard pattern (see <c>PSUBSCRIBE</c>)
2121
/// </summary>
22-
public bool IsPatternBased => _isPatternBased;
22+
public bool IsPattern => _isPatternBased;
2323

2424
internal bool IsNull => Value == null;
2525

tests/StackExchange.Redis.Tests/ChannelTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void ValidateAutoPatternModeString(string name, bool useImplicitAutoPatte
2525
#pragma warning disable CS0618 // we need to test the operator
2626
RedisChannel channel = name;
2727
#pragma warning restore CS0618
28-
Assert.Equal(isPatternBased, channel.IsPatternBased);
28+
Assert.Equal(isPatternBased, channel.IsPattern);
2929
}
3030
finally
3131
{
@@ -53,7 +53,7 @@ public void ValidateModeSpecifiedIgnoresGlobalSetting(string name, RedisChannel.
5353
{
5454
RedisChannel.UseImplicitAutoPattern = useImplicitAutoPattern;
5555
RedisChannel channel = new(name, mode);
56-
Assert.Equal(isPatternBased, channel.IsPatternBased);
56+
Assert.Equal(isPatternBased, channel.IsPattern);
5757
}
5858
finally
5959
{
@@ -76,7 +76,7 @@ public void ValidateAutoPatternModeBytes(string name, bool useImplicitAutoPatter
7676
#pragma warning disable CS0618 // we need to test the operator
7777
RedisChannel channel = bytes;
7878
#pragma warning restore CS0618
79-
Assert.Equal(isPatternBased, channel.IsPatternBased);
79+
Assert.Equal(isPatternBased, channel.IsPattern);
8080
}
8181
finally
8282
{
@@ -105,7 +105,7 @@ public void ValidateModeSpecifiedIgnoresGlobalSettingBytes(string name, RedisCha
105105
{
106106
RedisChannel.UseImplicitAutoPattern = useImplicitAutoPattern;
107107
RedisChannel channel = new(bytes, mode);
108-
Assert.Equal(isPatternBased, channel.IsPatternBased);
108+
Assert.Equal(isPatternBased, channel.IsPattern);
109109
}
110110
finally
111111
{
@@ -128,21 +128,21 @@ public void ValidateLiteralPatternMode(string name, bool useImplicitAutoPattern)
128128

129129
// literal, string
130130
channel = RedisChannel.Literal(name);
131-
Assert.False(channel.IsPatternBased);
131+
Assert.False(channel.IsPattern);
132132

133133
// pattern, string
134134
channel = RedisChannel.Pattern(name);
135-
Assert.True(channel.IsPatternBased);
135+
Assert.True(channel.IsPattern);
136136

137137
var bytes = Encoding.UTF8.GetBytes(name);
138138

139139
// literal, byte[]
140140
channel = RedisChannel.Literal(bytes);
141-
Assert.False(channel.IsPatternBased);
141+
Assert.False(channel.IsPattern);
142142

143143
// pattern, byte[]
144144
channel = RedisChannel.Pattern(bytes);
145-
Assert.True(channel.IsPatternBased);
145+
Assert.True(channel.IsPattern);
146146
}
147147
finally
148148
{

tests/StackExchange.Redis.Tests/FailoverTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public async Task SubscriptionsSurviveConnectionFailureAsync()
203203
using var conn = (Create(allowAdmin: true, shared: false, log: Writer, syncTimeout: 1000) as ConnectionMultiplexer)!;
204204

205205
var profiler = conn.AddProfiler();
206-
RedisChannel channel = Me();
206+
RedisChannel channel = RedisChannel.Literal(Me());
207207
var sub = conn.GetSubscriber();
208208
int counter = 0;
209209
Assert.True(sub.IsConnected());
@@ -308,7 +308,7 @@ public async Task SubscriptionsSurvivePrimarySwitchAsync()
308308
using var aConn = Create(allowAdmin: true, shared: false);
309309
using var bConn = Create(allowAdmin: true, shared: false);
310310

311-
RedisChannel channel = Me();
311+
RedisChannel channel = RedisChannel.Literal(Me());
312312
Log("Using Channel: " + channel);
313313
var subA = aConn.GetSubscriber();
314314
var subB = bConn.GetSubscriber();

0 commit comments

Comments
 (0)