예제 #1
0
 public VirtualDevice(String deviceId, RadiationDetector detector, int fwVersion, int hwVersion, DeviceModelType model, String ipAddress, String serverIpAddres, ICollection<DeviceReadings> readings)
 {
     this.DeviceId = deviceId;
     this.DetectorName = detector.Name;
     this.FirmwareVersion = fwVersion;
     this.HardwareVersion = hwVersion;
     this.Model = model;
     this.IPAddress = ipAddress;
     this.ServerIPAddress = serverIpAddres;
     this.readings = new List<DeviceReadings>(readings);
     this.ServerResponseCode = HttpStatus.OK;
 }
 public void Read(String filePath, String deviceId, int deviceType, int hwVersion, int fwVersion, DeviceModelType deviceModelType, String detector, int radiation, String radiationAverage, String temperature, String pressure, int voltage, int voltagePercent, int uptime, int wdt, String ip, String serverIp, String serverResponseCode)
 {
     IDeviceDataReader deviceDataReader = new DeviceDataFileReader(filePath);
     DeviceData deviceData = deviceDataReader.Read();
     Assert.AreEqual(deviceId, deviceData.DeviceInformation.DeviceID);
     Assert.AreEqual(hwVersion, deviceData.DeviceInformation.HardwareVersion);
     Assert.AreEqual(fwVersion, deviceData.DeviceInformation.FirmwareVersion);
     Assert.AreEqual(deviceModelType, deviceData.DeviceInformation.DeviceModel);
     Assert.AreEqual(detector, deviceData.DeviceInformation.Detector);
     Assert.AreEqual(radiation, deviceData.Radiation);
     Assert.AreEqual(double.Parse(radiationAverage), deviceData.RadiationAverage);
     Assert.AreEqual(double.Parse(temperature), deviceData.Temperature);
     Assert.AreEqual(pressure != null ? double.Parse(pressure) : (Nullable<double>)null, deviceData.Pressure);
     Assert.AreEqual(voltage, deviceData.Voltage);
     Assert.AreEqual(voltagePercent, deviceData.VoltagePercent);
     Assert.AreEqual(wdt, deviceData.WDT);
     Assert.AreEqual(uptime, deviceData.Uptime);
     Assert.AreEqual(ip, deviceData.IPAddress);
     Assert.AreEqual(serverIp, deviceData.ServerIPAddress);
     Assert.AreEqual(serverResponseCode, deviceData.ServerResponseCode);
 }