/// <summary> /// For mocking singletons. /// </summary> /// <param name="testVersion"></param> /// <param name="testWin10Version"></param> public static void OverrideSingletonsWithTestingObjects(OsVersion testVersion = null, Win10SystemVersion testWin10Version = null) { if (testWin10Version != null) { _win10Version = new Lazy <Win10SystemVersion>(() => testWin10Version); } if (testVersion != null) { _info = new Lazy <OsVersion>(() => testVersion); } }
public OsVersionInfo( OsVersion osVersion, PlatformID platformId, int majorVersion, int minorVersion, OsProductType osProductType = OsProductType.Invalid ) { OsVersion = osVersion; PlatformId = platformId; OperatingSystem = new OperatingSystem(platformId, new Version(majorVersion, minorVersion)); MajorVersion = majorVersion; MinorVersion = minorVersion; OsProductType = osProductType; }