mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +00:00
17 lines
389 B
C#
17 lines
389 B
C#
using System;
|
|
using System.Linq;
|
|
|
|
namespace QSB.Utility
|
|
{
|
|
public static class UnitTestDetector
|
|
{
|
|
public static readonly bool IsInUnitTest;
|
|
|
|
static UnitTestDetector()
|
|
{
|
|
const string testAssemblyName = "Microsoft.VisualStudio.TestPlatform.TestFramework";
|
|
IsInUnitTest = AppDomain.CurrentDomain.GetAssemblies()
|
|
.Any(a => a.FullName.StartsWith(testAssemblyName));
|
|
}
|
|
}
|
|
} |