From e66e3f66ef2e5aa6f34ce5a49555071e14b12559 Mon Sep 17 00:00:00 2001 From: Charlie Poole Date: Fri, 4 Dec 2026 18:31:24 -0800 Subject: [PATCH] Depend on the engine API build without NUnit.Extensibility.Api NUnit.Engine.Api 4.0.0-beta.101.8 no longer references NUnit.Extensibility.Api, so NUnit.Common no longer pulls it in. A new test checks that the engine API it builds against doesn't reference it (nunit/nunit-console#1980). Co-Authored-By: Claude Opus 5.5 --- Directory.Packages.props | 2 +- .../nunit.common.tests/DependencyTests.cs | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 src/NUnitCommon/nunit.common.tests/DependencyTests.cs diff --git a/Directory.Packages.props b/Directory.Packages.props index 8569bfa..e05d970 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -14,7 +14,7 @@ - + diff --git a/src/NUnitCommon/nunit.common.tests/DependencyTests.cs b/src/NUnitCommon/nunit.common.tests/DependencyTests.cs new file mode 100644 index 0000000..809a7bb --- /dev/null +++ b/src/NUnitCommon/nunit.common.tests/DependencyTests.cs @@ -0,0 +1,25 @@ +// Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt + +using System.Linq; +using NUnit.Engine; +using NUnit.Framework; + +namespace NUnit.Common +{ + /// + /// NUnit.Common depends on NUnit.Engine.Api, and NUnit.Extensibility depends on + /// NUnit.Common. If the engine API referenced NUnit.Extensibility.Api, which is + /// released with NUnit.Extensibility, the packages would form a cycle + /// (nunit/nunit-console#1980). + /// + public class DependencyTests + { + [Test] + public void EngineApiDoesNotReferenceExtensibilityApi() + { + var references = typeof(TestPackage).Assembly.GetReferencedAssemblies().Select(a => a.Name); + + Assert.That(references, Has.No.Member("NUnit.Extensibility.Api")); + } + } +}