Created
April 28, 2014 06:06
-
-
Save pawelpabich/11362860 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Reflection; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Xunit; | |
using Xunit.Sdk; | |
namespace XUnitMany | |
{ | |
public class Class1 | |
{ | |
[Fact] | |
public void Test11() | |
{ | |
Console.WriteLine("P11B"); | |
Thread.Sleep(5000); | |
Console.WriteLine("P11E"); | |
} | |
[Fact] | |
public void Test12() | |
{ | |
Console.WriteLine("P12B"); | |
Thread.Sleep(5000); | |
Console.WriteLine("P12E"); | |
} | |
} | |
public class Class2 | |
{ | |
public Class2() | |
{ | |
Thread.Sleep(1000); | |
} | |
[Fact] | |
public void Test21() | |
{ | |
Console.WriteLine("P21B"); | |
Thread.Sleep(5000); | |
Console.WriteLine("P21E"); | |
} | |
[Fact] | |
[SleepBeforeAndAfer] | |
public void Test22() | |
{ | |
Console.WriteLine("P22B"); | |
Thread.Sleep(5000); | |
Console.WriteLine("P22E"); | |
} | |
[Fact] | |
[SleepBeforeAndAfer] | |
public Task Test23() | |
{ | |
Console.WriteLine("P22B"); | |
Thread.Sleep(5000); | |
Console.WriteLine("P22E"); | |
return Task.Delay(1); | |
} | |
} | |
public class SleepBeforeAndAfer : BeforeAfterTestAttribute | |
{ | |
public override void Before(MethodInfo methodUnderTest) | |
{ | |
Thread.Sleep(2000); | |
} | |
public override void After(MethodInfo methodUnderTest) | |
{ | |
Thread.Sleep(2000); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment