Created
February 19, 2016 17:22
-
-
Save jameswritescode/0dc73d3da81f3a06bf55 to your computer and use it in GitHub Desktop.
This file contains hidden or 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.Collections.Generic; | |
| using System.Linq; | |
| using Xunit.Abstractions; | |
| using Xunit.Sdk; | |
| namespace DotNetMVCTest | |
| { | |
| public class DefinitionOrderer : ITestCaseOrderer | |
| { | |
| private readonly IMessageSink diagnosticMessageSink; | |
| public DefinitionOrderer(IMessageSink diagnosticMessageSink) | |
| { | |
| this.diagnosticMessageSink = diagnosticMessageSink; | |
| } | |
| public IEnumerable<TTestCase> OrderTestCases<TTestCase>(IEnumerable<TTestCase> testCases) | |
| where TTestCase : ITestCase | |
| { | |
| var result = testCases.ToList(); | |
| var message = new DiagnosticMessage("Ordered {0} test cases", result.Count); | |
| diagnosticMessageSink.OnMessage(message); | |
| return result; | |
| } | |
| } | |
| } |
This file contains hidden or 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.Collections.Generic; | |
| using System.Linq; | |
| using Xunit; | |
| [TestCaseOrderer("DotNetMVCTest.DefinitionOrderer", "DotNetMVCTest")] | |
| public class SampleTests | |
| { | |
| [Fact] | |
| public void Test2() | |
| { | |
| Assert.True(false); | |
| } | |
| [Fact] | |
| public void Test1() | |
| { | |
| Assert.True(false); | |
| } | |
| [Fact] | |
| public void YyzTest() { | |
| Assert.True(false); | |
| } | |
| [Fact] | |
| public void SomethingTest() { | |
| Assert.True(false); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment