private static ModelDeviceSample GenerateSampleDeice(string manufacture, string model, string serialNumber, string firmwareVersion, string ipAddress, string deviceName) { var sampleDevice = new ModelDeviceSample(); sampleDevice.Manufacturer = manufacture; sampleDevice.ModelNumber = model; sampleDevice.SerialNumber = serialNumber; sampleDevice.FirmwareRevision = firmwareVersion; sampleDevice.IPAddress = ipAddress; sampleDevice.DeviceName = deviceName; return(sampleDevice); }
public void VerifyElementTestDevice() { var intfc1 = new ModelInterfaceSample { VisaInterfaceId = "SAMP0", SiclInterfaceId = "samp", LogicalUnit = "100" }; var instrument1 = new ModelDeviceSample { Manufacturer = "KT", ModelNumber = "DEV001", SerialNumber = "X01234", FirmwareRevision = "1.0.0.1", IPAddress = "192.168.56.128", DeviceName = "inst0" }; instrument1.Parent = intfc1; instrument1.ParentId = intfc1.PersistentId; var hwconfig1 = GenerateHwConfig(); hwconfig1.VerifyElement(instrument1); Assert.IsTrue(!instrument1.Failed); Assert.IsTrue(instrument1.Verified); var intfc2 = new ModelInterfaceSample { VisaInterfaceId = "SAMP1", SiclInterfaceId = "samp1", LogicalUnit = "101" }; var instrument2 = new ModelDeviceSample { Manufacturer = "KT", ModelNumber = "DEV001", SerialNumber = "X01234", FirmwareRevision = "1.0.0.1", IPAddress = "192.168.56.130", DeviceName = "inst0" }; instrument2.Parent = intfc2; instrument2.ParentId = intfc2.PersistentId; var hwconfig2 = GenerateHwConfig(); hwconfig2.VerifyElement(instrument2); Assert.IsTrue(instrument2.Failed); Assert.IsTrue(!instrument2.Verified); }