diff options
Diffstat (limited to 'src/DotNetOpenAuth.Test/TestBase.cs')
-rw-r--r-- | src/DotNetOpenAuth.Test/TestBase.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/DotNetOpenAuth.Test/TestBase.cs b/src/DotNetOpenAuth.Test/TestBase.cs index 92adafa..612d871 100644 --- a/src/DotNetOpenAuth.Test/TestBase.cs +++ b/src/DotNetOpenAuth.Test/TestBase.cs @@ -8,6 +8,7 @@ namespace DotNetOpenAuth.Test { using System; using System.IO; using System.Reflection; + using System.Threading.Tasks; using System.Web; using DotNetOpenAuth.Messaging.Reflection; using DotNetOpenAuth.OAuth.Messages; @@ -67,7 +68,7 @@ namespace DotNetOpenAuth.Test { log4net.LogManager.Shutdown(); } - internal static Stats MeasurePerformance(Action action, float maximumAllowedUnitTime, int samples = 10, int iterations = 100, string name = null) { + internal static Stats MeasurePerformance(Func<Task> action, float maximumAllowedUnitTime, int samples = 10, int iterations = 100, string name = null) { if (!PerformanceTestUtilities.IsOptimized(typeof(OpenIdRelyingParty).Assembly)) { Assert.Inconclusive("Unoptimized code."); } @@ -75,7 +76,7 @@ namespace DotNetOpenAuth.Test { var timer = new MultiSampleCodeTimer(samples, iterations); Stats stats; using (new HighPerformance()) { - stats = timer.Measure(name ?? TestContext.CurrentContext.Test.FullName, action); + stats = timer.Measure(name ?? TestContext.CurrentContext.Test.FullName, action().Wait()); } stats.AdjustForScale(PerformanceTestUtilities.Baseline.Median); |