// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. using System; namespace Microsoft.TestCommon { /// /// Used to retrieve the currently running platform. /// public static class PlatformInfo { private const string _net45TypeName = "System.IWellKnownStringEqualityComparer, mscorlib, Version=4.0.0.0, PublicKeyToken=b77a5c561934e089"; private static Lazy _platform = new Lazy(GetPlatform, isThreadSafe: true); /// /// Gets the platform that the unit test is currently running on. /// public static Platform Platform { get { return _platform.Value; } } private static Platform GetPlatform() { if (Type.GetType(_net45TypeName, throwOnError: false) != null) { return Platform.Net45; } return Platform.Net40; } } }