<PackageReference Include="NUnit" Version="4.2.2" />

NUnit.Framework.Internal.Abstractions.IDebugger

interface IDebugger
A layer of abstraction around Debugger to facilitate testing.
bool IsAttached { get; }

Whether a debugger is currently attached to the process.