@@ -92,41 +92,42 @@ public async Task Create_ServerError_ThrowsMQ9Error()
9292 // ── send ──────────────────────────────────────────────────────────────────
9393
9494 [ Fact ]
95- public async Task Send_PublishesCorrectSubject ( )
95+ public async Task Send_NormalPriority_UsesBareSubject ( )
9696 {
9797 var mock = Substitute . For < INatsConnection > ( ) ;
9898 var client = ClientWithMock ( mock ) ;
9999
100100 await client . SendAsync ( "m-001" , "hello"u8 . ToArray ( ) , Priority . Normal ) ;
101101
102+ // normal uses bare subject (no suffix)
102103 await mock . Received ( 1 ) . PublishAsync (
103- "$mq9.AI.MAILBOX.MSG.m-001.normal " ,
104+ "$mq9.AI.MAILBOX.MSG.m-001" ,
104105 Arg . Any < byte [ ] > ( ) ) ;
105106 }
106107
107108 [ Fact ]
108- public async Task Send_HighPriority_CorrectSubject ( )
109+ public async Task Send_CriticalPriority_UsesSuffix ( )
109110 {
110111 var mock = Substitute . For < INatsConnection > ( ) ;
111112 var client = ClientWithMock ( mock ) ;
112113
113- await client . SendAsync ( "m-001" , "urgent "u8 . ToArray ( ) , Priority . High ) ;
114+ await client . SendAsync ( "m-001" , "abort "u8 . ToArray ( ) , Priority . Critical ) ;
114115
115116 await mock . Received ( 1 ) . PublishAsync (
116- "$mq9.AI.MAILBOX.MSG.m-001.high " ,
117+ "$mq9.AI.MAILBOX.MSG.m-001.critical " ,
117118 Arg . Any < byte [ ] > ( ) ) ;
118119 }
119120
120121 [ Fact ]
121- public async Task Send_LowPriority_CorrectSubject ( )
122+ public async Task Send_UrgentPriority_UsesSuffix ( )
122123 {
123124 var mock = Substitute . For < INatsConnection > ( ) ;
124125 var client = ClientWithMock ( mock ) ;
125126
126- await client . SendAsync ( "m-001" , "bg "u8 . ToArray ( ) , Priority . Low ) ;
127+ await client . SendAsync ( "m-001" , "interrupt "u8 . ToArray ( ) , Priority . Urgent ) ;
127128
128129 await mock . Received ( 1 ) . PublishAsync (
129- "$mq9.AI.MAILBOX.MSG.m-001.low " ,
130+ "$mq9.AI.MAILBOX.MSG.m-001.urgent " ,
130131 Arg . Any < byte [ ] > ( ) ) ;
131132 }
132133
@@ -151,7 +152,7 @@ public async Task Subscribe_AllPriorities_UsesWildcardSubject()
151152 }
152153
153154 [ Fact ]
154- public async Task Subscribe_SinglePriority_UsesSpecificSubject ( )
155+ public async Task Subscribe_CriticalPriority_UsesSuffixedSubject ( )
155156 {
156157 var mock = Substitute . For < INatsConnection > ( ) ;
157158 var capturedSubject = "" ;
@@ -164,9 +165,29 @@ public async Task Subscribe_SinglePriority_UsesSpecificSubject()
164165 var client = ClientWithMock ( mock ) ;
165166
166167 await using var _ = await client . SubscribeAsync ( "m-001" , async _ => await Task . CompletedTask ,
167- priority : Priority . High ) ;
168+ priority : Priority . Critical ) ;
168169
169- Assert . Equal ( "$mq9.AI.MAILBOX.MSG.m-001.high" , capturedSubject ) ;
170+ Assert . Equal ( "$mq9.AI.MAILBOX.MSG.m-001.critical" , capturedSubject ) ;
171+ }
172+
173+ [ Fact ]
174+ public async Task Subscribe_NormalPriority_UsesBareSubject ( )
175+ {
176+ var mock = Substitute . For < INatsConnection > ( ) ;
177+ var capturedSubject = "" ;
178+ mock . SubscribeCoreAsync < byte [ ] > ( Arg . Any < string > ( ) , cancellationToken : Arg . Any < CancellationToken > ( ) )
179+ . Returns ( callInfo =>
180+ {
181+ capturedSubject = callInfo . ArgAt < string > ( 0 ) ;
182+ return ValueTask . FromResult ( Substitute . For < INatsSub < byte [ ] > > ( ) ) ;
183+ } ) ;
184+ var client = ClientWithMock ( mock ) ;
185+
186+ await using var _ = await client . SubscribeAsync ( "m-001" , async _ => await Task . CompletedTask ,
187+ priority : Priority . Normal ) ;
188+
189+ // normal uses bare subject (no suffix)
190+ Assert . Equal ( "$mq9.AI.MAILBOX.MSG.m-001" , capturedSubject ) ;
170191 }
171192
172193 [ Fact ]
@@ -210,7 +231,7 @@ await Assert.ThrowsAsync<InvalidOperationException>(
210231 public async Task List_ReturnsMessageMeta ( )
211232 {
212233 var json = "{\" mail_id\" :\" m-001\" ,\" messages\" :[{\" msg_id\" :\" x1\" ,"
213- + "\" priority\" :\" high \" ,\" ts\" :100}]}" ;
234+ + "\" priority\" :\" critical \" ,\" ts\" :100}]}" ;
214235
215236 var mock = Substitute . For < INatsConnection > ( ) ;
216237 mock . RequestAsync < byte [ ] , byte [ ] > (
@@ -223,7 +244,7 @@ public async Task List_ReturnsMessageMeta()
223244
224245 Assert . Single ( metas ) ;
225246 Assert . Equal ( "x1" , metas [ 0 ] . MsgId ) ;
226- Assert . Equal ( Priority . High , metas [ 0 ] . Priority ) ;
247+ Assert . Equal ( Priority . Critical , metas [ 0 ] . Priority ) ;
227248 Assert . Equal ( 100L , metas [ 0 ] . Ts ) ;
228249 }
229250
0 commit comments