Skip to content

Commit

Permalink
Merge pull request petabridge#103 from Aaronontheweb/TestRunner-cleanup
Browse files Browse the repository at this point in the history
added some code contracts to TestRunner
  • Loading branch information
Aaronontheweb committed Apr 9, 2016
2 parents 5550935 + be7e14d commit 85c6c23
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/NBench/Sdk/TestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using NBench.Sdk.Compiler;
using System;
using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Threading;

namespace NBench.Sdk
Expand Down Expand Up @@ -46,6 +47,7 @@ public TestRunner(TestPackage package)
/// <returns></returns>
public static TestRunner CreateRunner(AppDomain domain, TestPackage package)
{
Contract.Requires(domain != null);
var runnerType = typeof(TestRunner);
return domain.CreateInstanceAndUnwrap(runnerType.Assembly.FullName, runnerType.FullName, false, 0, null, new object[] { package }, null, null) as TestRunner;
}
Expand All @@ -58,6 +60,7 @@ public static TestRunner CreateRunner(AppDomain domain, TestPackage package)
/// <remarks>Creates a new AppDomain and executes the tests.</remarks>
public static TestRunnerResult Run(TestPackage package)
{
Contract.Requires(package != null);
// create the test app domain
var testDomain = DomainManager.CreateDomain(package);

Expand Down

0 comments on commit 85c6c23

Please sign in to comment.