forked from xunit/xunit
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ability to sort test collections.
- Loading branch information
1 parent
226f186
commit 74eb583
Showing
6 changed files
with
79 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Xunit.Abstractions; | ||
|
||
namespace Xunit.Sdk | ||
{ | ||
/// <summary> | ||
/// A class implements this interface to participate in ordering test collections | ||
/// for the test runner. Test collection orderers are applied using the | ||
/// <see cref="TestCollectionOrdererAttribute"/>, which can be applied at | ||
/// the assembly level. | ||
/// </summary> | ||
public interface ITestCollectionOrderer | ||
{ | ||
/// <summary> | ||
/// Orders test collections for execution. | ||
/// </summary> | ||
/// <param name="testCollections">The test collections to be ordered.</param> | ||
/// <returns>The test collections in the order to be run.</returns> | ||
IEnumerable<IGrouping<ITestCollection, TTestCase>> OrderTestCollections<TTestCase>(IEnumerable<IGrouping<ITestCollection, TTestCase>> testCollections) where TTestCase : ITestCase; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System; | ||
|
||
namespace Xunit | ||
{ | ||
/// <summary> | ||
/// Used to decorate an assembly to allow | ||
/// the use a custom <see cref="T:Xunit.Sdk.ICollectionOrderer"/>. | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Assembly, Inherited = true, AllowMultiple = false)] | ||
public sealed class TestCollectionOrdererAttribute : Attribute | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="TestCollectionOrdererAttribute"/> class. | ||
/// </summary> | ||
/// <param name="ordererTypeName">The type name of the orderer class (that implements <see cref="T:Xunit.Sdk.ICollectionOrderer"/>).</param> | ||
/// <param name="ordererAssemblyName">The assembly that <paramref name="ordererTypeName"/> exists in.</param> | ||
public TestCollectionOrdererAttribute(string ordererTypeName, string ordererAssemblyName) { } | ||
} | ||
} |
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
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
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
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