File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
test/Microsoft.Azure.ServiceBus.UnitTests/Primitives Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ namespace Microsoft.Azure.ServiceBus.UnitTests.Primitives
1010 using Microsoft . Azure . ServiceBus . Core ;
1111 using Xunit ;
1212
13- public class BatchTests
13+ public class MessageBatchTests
1414 {
15- private Func < Message , Task < Message > > fakePluginsCallback = Task . FromResult ;
15+ private readonly Func < Message , Task < Message > > fakePluginsCallback = Task . FromResult ;
1616
1717 [ Fact ]
1818 public async Task Should_return_false_when_is_about_to_exceed_max_batch_size ( )
@@ -25,24 +25,24 @@ public async Task Should_return_false_when_is_about_to_exceed_max_batch_size()
2525 }
2626
2727 [ Fact ]
28- public void Should_throw_if_batch_disposed ( )
28+ public async Task Should_throw_if_batch_disposed ( )
2929 {
3030 using ( var batch = new MessageBatch ( 1 , fakePluginsCallback ) )
3131 {
3232 batch . Dispose ( ) ;
33- Assert . ThrowsAsync < Exception > ( ( ) => batch . TryAdd ( new Message ( ) ) ) ;
33+ await Assert . ThrowsAsync < ObjectDisposedException > ( ( ) => batch . TryAdd ( new Message ( ) ) ) ;
3434 }
3535 }
3636
3737 [ Fact ]
38- public void Should_throw_when_trying_to_add_an_already_received_message_to_batch ( )
38+ public async Task Should_throw_when_trying_to_add_an_already_received_message_to_batch ( )
3939 {
4040 using ( var batch = new MessageBatch ( 100 , fakePluginsCallback ) )
4141 {
4242 var message = new Message ( "test" . GetBytes ( ) ) ;
4343 message . SystemProperties . LockTokenGuid = Guid . NewGuid ( ) ;
4444
45- Assert . ThrowsAsync < ArgumentException > ( ( ) => batch . TryAdd ( message ) ) ;
45+ await Assert . ThrowsAsync < ArgumentException > ( ( ) => batch . TryAdd ( message ) ) ;
4646 }
4747 }
4848
You can’t perform that action at this time.
0 commit comments