From a24876c93977f9899302eaa07d0f50afd1597016 Mon Sep 17 00:00:00 2001 From: Bryan Wilhite Date: Wed, 7 Feb 2024 17:47:05 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=F0=9F=94=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SonghayCore.OrderedTests/Assembly.cs | 2 - .../Orderers/OrderedTestBaseFailureTests.cs | 47 ------------------- .../Orderers/OrderedTestBaseTests.cs | 2 - SonghayCore.xUnit/Orderers/OrderedTestBase.cs | 2 +- 4 files changed, 1 insertion(+), 52 deletions(-) delete mode 100644 SonghayCore.OrderedTests/Orderers/OrderedTestBaseFailureTests.cs diff --git a/SonghayCore.OrderedTests/Assembly.cs b/SonghayCore.OrderedTests/Assembly.cs index e9c0a54f..5b2d4b6c 100644 --- a/SonghayCore.OrderedTests/Assembly.cs +++ b/SonghayCore.OrderedTests/Assembly.cs @@ -5,7 +5,5 @@ global using Xunit.Sdk; global using Songhay.Extensions; -global using Songhay.Tests.Orderers; [assembly: CollectionBehavior(DisableTestParallelization = true)] -[assembly: TestCaseOrderer(TestCaseOrderer.TypeName, ordererAssemblyName: TestCaseOrderer.AssemblyName)] diff --git a/SonghayCore.OrderedTests/Orderers/OrderedTestBaseFailureTests.cs b/SonghayCore.OrderedTests/Orderers/OrderedTestBaseFailureTests.cs deleted file mode 100644 index db7cef26..00000000 --- a/SonghayCore.OrderedTests/Orderers/OrderedTestBaseFailureTests.cs +++ /dev/null @@ -1,47 +0,0 @@ -namespace Songhay.Tests.Orderers; - -public class OrderedTestBaseFailureTests : OrderedTestBase -{ - static readonly List MethodCalls = new(); - - static int _currentValue = 32; - - public OrderedTestBaseFailureTests(ITestOutputHelper testOutputHelper) - { - _testOutputHelper = testOutputHelper; - } - - [Fact, TestOrder(ordinal: 0, reason: "Subtract 8")] - public void ShouldSubtract8() - { - AssertNoXUnitException(); - MethodCalls.Add(nameof(ShouldSubtract8)); - - const int wrongValue = 42; - - _currentValue -= wrongValue; - - Assert.Equal(24, _currentValue); - } - - [Fact, TestOrder(ordinal: 1, reason: "Subtract 4")] - public void ShouldSubtract4() - { - Assert.True(XUnitExceptionHasOccurred); - - MethodCalls.Add(nameof(ShouldSubtract4)); - } - - [Fact, TestOrder(ordinal: 2, reason: "Subtract 4 again")] - public void ShouldSubtract4Again() - { - Assert.True(XUnitExceptionHasOccurred); - - MethodCalls.Add(nameof(ShouldSubtract4Again)); - - _testOutputHelper.WriteLine("method calls:"); - MethodCalls.ForEachInEnumerable(m => _testOutputHelper.WriteLine(m)); - } - - readonly ITestOutputHelper _testOutputHelper; -} diff --git a/SonghayCore.OrderedTests/Orderers/OrderedTestBaseTests.cs b/SonghayCore.OrderedTests/Orderers/OrderedTestBaseTests.cs index cf7034b3..f3d28db0 100644 --- a/SonghayCore.OrderedTests/Orderers/OrderedTestBaseTests.cs +++ b/SonghayCore.OrderedTests/Orderers/OrderedTestBaseTests.cs @@ -1,5 +1,3 @@ -using Songhay.Extensions; - namespace Songhay.Tests.Orderers; public class OrderedTestBaseTests : OrderedTestBase diff --git a/SonghayCore.xUnit/Orderers/OrderedTestBase.cs b/SonghayCore.xUnit/Orderers/OrderedTestBase.cs index 1b365488..66352b97 100644 --- a/SonghayCore.xUnit/Orderers/OrderedTestBase.cs +++ b/SonghayCore.xUnit/Orderers/OrderedTestBase.cs @@ -7,7 +7,7 @@ /// For more detail, see “How to Order xUnit Tests and Collections” by Tom DuPont /// [http://www.tomdupont.net/2016/04/how-to-order-xunit-tests-and-collections.html] /// -[TestCaseOrderer(TestCaseOrderer.TypeName, TestCaseOrderer.AssemblyName)] +[TestCaseOrderer(TestCaseOrderer.TypeName, ordererAssemblyName: TestCaseOrderer.AssemblyName)] public abstract class OrderedTestBase { ///