Skip to content

Commit

Permalink
Return Task for async tests
Browse files Browse the repository at this point in the history
This is good practive.
  • Loading branch information
par.dahlman committed Nov 26, 2015
1 parent 87aee78 commit 644e6a6
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using RabbitMQ.Client.Exceptions;
using System.Threading.Tasks;
using RabbitMQ.Client.Exceptions;
using RawRabbit.Common;
using RawRabbit.Configuration;
using RawRabbit.vNext;
Expand All @@ -9,7 +10,7 @@ namespace RawRabbit.IntegrationTests.Features
public class AuthenticationTests
{
[Fact]
public async void Should_Give_Clear_Error_Message_If_User_Does_Not_Exist()
public async Task Should_Give_Clear_Error_Message_If_User_Does_Not_Exist()
{
/* Setup */
var config = new RawRabbitConfiguration
Expand All @@ -32,7 +33,7 @@ public async void Should_Give_Clear_Error_Message_If_User_Does_Not_Exist()
}

[Fact]
public async void Should_Use_Guest_Credentials_By_Default()
public async Task Should_Use_Guest_Credentials_By_Default()
{
/* Setup */
var config = new RawRabbitConfiguration();
Expand All @@ -45,7 +46,7 @@ public async void Should_Use_Guest_Credentials_By_Default()
}

[Fact]
public async void Should_Not_Throw_If_Credentials_Are_Correct()
public async Task Should_Not_Throw_If_Credentials_Are_Correct()
{
/* Setup */
var config = new RawRabbitConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public LostConnectionTests()
}

[Fact]
public async void Should_Succeed_To_Send_Response_Even_If_Channel_Is_Closed()
public async Task Should_Succeed_To_Send_Response_Even_If_Channel_Is_Closed()
{
/* Setup */
var channelFactory = new ChannelFactory(new SingleNodeBroker(BrokerConfiguration.Local));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace RawRabbit.IntegrationTests.Features
public class MessageContextTests
{
[Fact]
public async void Should_Send_Message_Context_Correctly()
public async Task Should_Send_Message_Context_Correctly()
{
/* Setup */
var subscriber = BusClientFactory.CreateDefault();
Expand All @@ -41,7 +41,7 @@ public async void Should_Send_Message_Context_Correctly()
}

[Fact]
public async void Should_Forward_Context_On_Publish()
public async Task Should_Forward_Context_On_Publish()
{
/* Setup */
var firstCtxTcs = new TaskCompletionSource<MessageContext>();
Expand Down Expand Up @@ -70,7 +70,7 @@ public async void Should_Forward_Context_On_Publish()
}

[Fact]
public async void Should_Forward_Context_On_Rpc()
public async Task Should_Forward_Context_On_Rpc()
{
/* Setup */
var tcs = new TaskCompletionSource<bool>();
Expand Down Expand Up @@ -102,7 +102,7 @@ public async void Should_Forward_Context_On_Rpc()
}

[Fact]
public async void Should_Forward_Context_On_Rpc_To_Publish()
public async Task Should_Forward_Context_On_Rpc_To_Publish()
{
/* Setup */
var tcs = new TaskCompletionSource<bool>();
Expand Down
4 changes: 2 additions & 2 deletions src/RawRabbit.IntegrationTests/Features/NackingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public NackingTests()
}

[Fact]
public async void Should_Be_Able_To_Nack_Message()
public async Task Should_Be_Able_To_Nack_Message()
{
/* Setup */
var service = new ServiceCollection()
Expand Down Expand Up @@ -76,7 +76,7 @@ public async void Should_Be_Able_To_Nack_Message()
}

[Fact]
public async void Should_Be_Able_To_Nack_On_Subscribe()
public async Task Should_Be_Able_To_Nack_On_Subscribe()
{
/* Setup */
var service = new ServiceCollection()
Expand Down
4 changes: 2 additions & 2 deletions src/RawRabbit.IntegrationTests/Features/TimeoutTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace RawRabbit.IntegrationTests.Features
public class TimeoutTests
{
[Fact]
public async void Should_Interupt_Task_After_Timeout_Not_Met()
public async Task Should_Interupt_Task_After_Timeout_Not_Met()
{
/* Setup */
var responder = BusClientFactory.CreateDefault();
Expand All @@ -28,7 +28,7 @@ public async void Should_Interupt_Task_After_Timeout_Not_Met()
}

[Fact]
public async void Should_Not_Throw_If_Response_Is_Handled_Within_Time_Limit()
public async Task Should_Not_Throw_If_Response_Is_Handled_Within_Time_Limit()
{
/* Setup */
var responder = BusClientFactory.CreateDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public override void Dispose()
}

[Fact]
public async void Should_Support_The_Hello_World_Tutorial()
public async Task Should_Support_The_Hello_World_Tutorial()
{
/* Setup */
var sent = new BasicMessage { Prop = "Hello, world!" };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public override void Dispose()
}

[Fact]
public async void Should_Support_The_Worker_Queues_Tutorial()
public async Task Should_Support_The_Worker_Queues_Tutorial()
{
/* Setup */
var sent = new BasicMessage { Prop = "Hello, world!" };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace RawRabbit.IntegrationTests.SimpleUse
public class MultipleRequestsTests
{
[Fact]
public async void Should_Just_Work()
public async Task Should_Just_Work()
{
/* Setup */
const int numberOfCalls = 10000;
Expand Down Expand Up @@ -46,7 +46,7 @@ public async void Should_Just_Work()
}

[Fact]
public async void Should_Work_For_Multiple_Types()
public async Task Should_Work_For_Multiple_Types()
{
/* Setup */
const int numberOfCalls = 10000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public override void Dispose()
}

[Fact]
public async void Should_Be_Able_To_Subscribe_Without_Any_Additional_Config()
public async Task Should_Be_Able_To_Subscribe_Without_Any_Additional_Config()
{
/* Setup */
var message = new BasicMessage { Prop = "Hello, world!" };
Expand All @@ -45,7 +45,7 @@ public async void Should_Be_Able_To_Subscribe_Without_Any_Additional_Config()
}

[Fact]
public async void Should_Be_Able_To_Perform_Multiple_Pub_Subs()
public async Task Should_Be_Able_To_Perform_Multiple_Pub_Subs()
{
/* Setup */
var subscriber = BusClientFactory.CreateDefault();
Expand Down
10 changes: 5 additions & 5 deletions src/RawRabbit.IntegrationTests/SimpleUse/RpcTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace RawRabbit.IntegrationTests.SimpleUse
public class RpcTest : IntegrationTestBase
{
[Fact]
public async void Should_Perform_Basic_Rpc_Without_Any_Config()
public async Task Should_Perform_Basic_Rpc_Without_Any_Config()
{
/* Setup */
var response = new BasicResponse { Prop = "This is the reponse." };
Expand All @@ -34,7 +34,7 @@ public async void Should_Perform_Basic_Rpc_Without_Any_Config()
}

[Fact]
public async void Should_Perform_Rpc_Without_Direct_Reply_To()
public async Task Should_Perform_Rpc_Without_Direct_Reply_To()
{
/* Setup */
var response = new BasicResponse { Prop = "This is the reponse." };
Expand All @@ -60,7 +60,7 @@ public async void Should_Perform_Rpc_Without_Direct_Reply_To()
}

[Fact]
public async void Should_Succeed_With_Multiple_Rpc_Calls_At_The_Same_Time()
public async Task Should_Succeed_With_Multiple_Rpc_Calls_At_The_Same_Time()
{
/* Setup */
var payloads = new List<Guid> { Guid.NewGuid(), Guid.NewGuid(), Guid.NewGuid() };
Expand Down Expand Up @@ -93,7 +93,7 @@ public async void Should_Succeed_With_Multiple_Rpc_Calls_At_The_Same_Time()
}

[Fact]
public async void Should_Successfully_Perform_Nested_Requests()
public async Task Should_Successfully_Perform_Nested_Requests()
{
/* Setup */
var payload = Guid.NewGuid();
Expand All @@ -119,7 +119,7 @@ public async void Should_Successfully_Perform_Nested_Requests()
}

[Fact]
public async void Should_Work_With_Queueing_Consumer_Factory()
public async Task Should_Work_With_Queueing_Consumer_Factory()
{
/* Setup */
var response = new BasicResponse { Prop = "This is the reponse." };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace RawRabbit.IntegrationTests.SimpleUse
public class SubscribeToDifferentMessageTypes : IntegrationTestBase
{
[Fact]
public async void Should_Be_Able_To_Recieve_Different_Types_Of_Messages()
public async Task Should_Be_Able_To_Recieve_Different_Types_Of_Messages()
{
/* Setup */
var publisher = BusClientFactory.CreateDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public override void Dispose()
}

[Fact]
public async void Should_Deliver_Message_To_All_Subscribers_On_Exchange()
public async Task Should_Deliver_Message_To_All_Subscribers_On_Exchange()
{
/* Setup */
var publisher = BusClientFactory.CreateDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace RawRabbit.IntegrationTests.SimpleUse
public class WorkerQueuesTest : IntegrationTestBase
{
[Fact]
public async void Should_Call_Handle_Method_Just_As_Many_Times_As_Published()
public async Task Should_Call_Handle_Method_Just_As_Many_Times_As_Published()
{
/* Setup */
var firstWorker = BusClientFactory.CreateDefault();
Expand Down

0 comments on commit 644e6a6

Please sign in to comment.