quantum-space-buddies/QSB/Utility/UnitTestDetector.cs

17 lines
455 B
C#
Raw Normal View History

2021-02-12 13:29:01 +00:00
using System;
using System.Linq;
namespace QSB.Utility
{
public static class UnitTestDetector
{
static UnitTestDetector()
{
var testAssemblyName = "Microsoft.VisualStudio.TestPlatform.TestFramework";
IsInUnitTest = AppDomain.CurrentDomain.GetAssemblies()
.Any(a => a.FullName.StartsWith(testAssemblyName));
}
public static bool IsInUnitTest { get; private set; }
}
2021-02-13 09:07:39 +00:00
}