Skip to content

Commit

Permalink
Added async methods to start/finish test items
Browse files Browse the repository at this point in the history
  • Loading branch information
nvborisenko committed Feb 22, 2017
1 parent be5a65d commit 5077ec9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ReportPortal.Client/Service.Launch.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using ReportPortal.Client.Extentions;
using ReportPortal.Client.Filtering;
using ReportPortal.Client.Models;
Expand Down
21 changes: 21 additions & 0 deletions src/ReportPortal.Client/Service.TestItem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using ReportPortal.Client.Extentions;
using ReportPortal.Client.Filtering;
using ReportPortal.Client.Models;
Expand Down Expand Up @@ -73,6 +74,11 @@ public TestItem StartTestItem(StartTestItemRequest model)
return JsonConvert.DeserializeObject<TestItem>(response.Content);
}

public async Task<TestItem> StartTestItemAsync(StartTestItemRequest model)
{
return await Task.Run(() => StartTestItem(model));
}

/// <summary>
/// Creates a new test item.
/// </summary>
Expand All @@ -88,6 +94,11 @@ public TestItem StartTestItem(string id, StartTestItemRequest model)
return JsonConvert.DeserializeObject<TestItem>(response.Content);
}

public async Task<TestItem> StartTestItemAsync(string id, StartTestItemRequest model)
{
return await Task.Run(() => StartTestItem(id, model));
}

/// <summary>
/// Finishes specified test item.
/// </summary>
Expand All @@ -103,6 +114,11 @@ public Message FinishTestItem(string id, FinishTestItemRequest model)
return JsonConvert.DeserializeObject<Message>(response.Content);
}

public async Task<Message> FinishTestItemAsync(string id, FinishTestItemRequest model)
{
return await Task.Run(() => FinishTestItem(id, model));
}

/// <summary>
/// Update specified test item.
/// </summary>
Expand All @@ -118,6 +134,11 @@ public Message UpdateTestItem(string id, UpdateTestItemRequest model)
return JsonConvert.DeserializeObject<Message>(response.Content);
}

public async Task<Message> UpdateTestItemAsync(string id, UpdateTestItemRequest model)
{
return await Task.Run(() => UpdateTestItem(id, model));
}

/// <summary>
/// Deletes specified test item.
/// </summary>
Expand Down

0 comments on commit 5077ec9

Please sign in to comment.