private static ICpuIdX86 GetCpu(string fileName) { string fullPath = Path.Combine(TestResources, fileName); CpuIdXmlFactory factory = new CpuIdXmlFactory(); ICpuId cpu = factory.Create(fullPath); ICpuIdX86 x86cpu = cpu as ICpuIdX86; Assert.That(x86cpu, Is.Not.Null); Assert.That(x86cpu.Topology.CoreTopology.IsReadOnly, Is.True); return(x86cpu); }
public void LoadCpu(string fileName) { CpuIdXmlFactory factory = new CpuIdXmlFactory(); Cpu = factory.Create(fileName) as ICpuIdX86; if (Cpu == null) { throw new InvalidOperationException("Couldn't load CPU file"); } Cpus = factory.CreateAll(fileName).OfType <ICpuIdX86>(); Initialize(); }
private static GenericIntelCpu GetCpu(string fileName) { string fullPath = Path.Combine(TestResources, fileName); CpuIdXmlFactory factory = new CpuIdXmlFactory(); ICpuId cpu = factory.Create(fullPath); GenericIntelCpu x86cpu = cpu as GenericIntelCpu; Assert.That(cpu, Is.Not.Null); Assert.That(cpu.CpuVendor, Is.EqualTo(CpuVendor.Unknown)); Assert.That(cpu.VendorId, Is.EqualTo(" ")); Assert.That(x86cpu.Topology.CoreTopology.IsReadOnly, Is.True); Assert.That(x86cpu.Topology.CoreTopology.Count, Is.EqualTo(0)); Assert.That(x86cpu.Topology.CacheTopology.IsReadOnly, Is.True); Assert.That(x86cpu.Topology.CacheTopology.Count, Is.EqualTo(0)); return(x86cpu); }