diff --git a/tests/NATS.Client.JetStream.Tests/ConsumerConsumeTest.cs b/tests/NATS.Client.JetStream.Tests/ConsumerConsumeTest.cs index e37bf670f..7b03bbfc9 100644 --- a/tests/NATS.Client.JetStream.Tests/ConsumerConsumeTest.cs +++ b/tests/NATS.Client.JetStream.Tests/ConsumerConsumeTest.cs @@ -14,6 +14,8 @@ public class ConsumerConsumeTest [Theory] [InlineData("Invalid.DotName")] [InlineData("Invalid SpaceName")] + [InlineData("Invalid*StarName")] + [InlineData("Invalid>WildcardName")] [InlineData(null)] public async Task Consumer_stream_invalid_name_test(string? streamName) { diff --git a/tests/NATS.Client.JetStream.Tests/JetStreamTest.cs b/tests/NATS.Client.JetStream.Tests/JetStreamTest.cs index 835353a50..cf7462c63 100644 --- a/tests/NATS.Client.JetStream.Tests/JetStreamTest.cs +++ b/tests/NATS.Client.JetStream.Tests/JetStreamTest.cs @@ -9,17 +9,11 @@ public class JetStreamTest public JetStreamTest(ITestOutputHelper output) => _output = output; - [Fact] - public void Invalid_stream_validation_test() - { - Assert.Throws(() => NatsJSContext.ThrowIfInvalidStreamName(null!)); - Assert.Throws(() => NatsJSContext.ThrowIfInvalidStreamName("Invalid.DotName")); - Assert.Throws(() => NatsJSContext.ThrowIfInvalidStreamName("Invalid SpaceName")); - } - [Theory] [InlineData("Invalid.DotName")] [InlineData("Invalid SpaceName")] + [InlineData("Invalid*StarName")] + [InlineData("Invalid>WildcardName")] [InlineData(null)] public async Task Stream_invalid_name_test(string? streamName) { diff --git a/tests/NATS.Client.JetStream.Tests/NatsJSContextTest.cs b/tests/NATS.Client.JetStream.Tests/NatsJSContextTest.cs index 8dbea0d5b..5d3900140 100644 --- a/tests/NATS.Client.JetStream.Tests/NatsJSContextTest.cs +++ b/tests/NATS.Client.JetStream.Tests/NatsJSContextTest.cs @@ -27,4 +27,14 @@ public void InterfaceShouldHaveSamePublicPropertiesEventsAndMethodAsClass() interfaceMethods.Select(m => m.Name).Should().Contain(name); } } + + [Fact] + public void Invalid_stream_validation_test() + { + Assert.Throws(() => NatsJSContext.ThrowIfInvalidStreamName(null!)); + Assert.Throws(() => NatsJSContext.ThrowIfInvalidStreamName("Invalid.DotName")); + Assert.Throws(() => NatsJSContext.ThrowIfInvalidStreamName("Invalid SpaceName")); + Assert.Throws(() => NatsJSContext.ThrowIfInvalidStreamName("Invalid*StarName")); + Assert.Throws(() => NatsJSContext.ThrowIfInvalidStreamName("Invalid>WildcardName")); + } }