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")); + } + } +}