Skip to content

Instantly share code, notes, and snippets.

@pawelpabich
Created April 26, 2014 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pawelpabich/11319066 to your computer and use it in GitHub Desktop.
Save pawelpabich/11319066 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Task.WaitAll(Suit(1, "Seq1"), Suit(2, "Seq2"), Suit(3, "Seq3"));
}
public static async Task Suit(int sequence, string key)
{
Console.WriteLine("##teamcity[testSuiteStarted name='Suite{0}' flowId='{1}']", sequence, key);
await Method1(sequence, key);
await Method2(sequence, key);
Console.WriteLine("##teamcity[testSuiteFinished name='Suite{0}' flowId='{1}']", sequence, key);
}
public static async Task Method1(int sequence, string key)
{
Console.WriteLine("##teamcity[testStarted name='Method1{0}' flowId='{1}']", sequence, key);
await Task.Delay(5000);
Console.WriteLine("Method12");
await Task.Delay(2000);
Console.WriteLine("Method13");
await Task.Delay(3000);
Console.WriteLine("Method14");
await Task.Delay(5000);
Console.WriteLine("##teamcity[testFinished name='Method1{0}' flowId='{1}']", sequence, key);
await Task.Delay(1000);
}
public static async Task Method2(int sequence, string key)
{
Console.WriteLine("##teamcity[testStarted name='Method2{0}' flowId='{1}']",sequence, key);
await Task.Delay(2000);
Console.WriteLine("Method22");
await Task.Delay(4000);
Console.WriteLine("Method23");
await Task.Delay(3000);
Console.WriteLine("Method24");
await Task.Delay(3000);
Console.WriteLine("##teamcity[testFinished name='Method2{0}' flowId='{1}']", sequence, key);
await Task.Delay(5000);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment