/// <summary>
        /// Returns the hardware specification for the local machine.
        /// </summary>
        /// <returns>
        /// The hardware specification for the local machine.
        /// </returns>
        public static HardwareSpecification ForLocalMachine()
        {
            var memorySizes = LocalMachinePhysicalMemorySize();
            var disks       = DiskSpecification.ForLocalMachine();

            return(new HardwareSpecification(
                       memorySizes.MaximumProcessMemorySizeInKiloBytes,
                       memorySizes.TotalPhysicalMemorySizeInKiloBytes,
                       memorySizes.TotalVirtualMemorySizeInKiloBytes,
                       disks));
        }
示例#2
0
        public void Create()
        {
            var   name       = "a";
            var   serial     = "b";
            ulong totalSpace = 10;
            ulong freeSpace  = 5;
            var   disk       = new DiskSpecification(name, serial, totalSpace, freeSpace);

            Assert.AreEqual(name, disk.Name);
            Assert.AreEqual(serial, disk.SerialNumber);
            Assert.AreEqual(totalSpace, disk.TotalSpaceInBytes);
            Assert.AreEqual(freeSpace, disk.AvailableSpaceInBytes);
        }