Exemplo n.º 1
0
        /// <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);
            }
        }
Exemplo n.º 2
0
 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;
 }