Example #1
0
        public void GetDevices()
        {
            // Arrange
            var devicesService = new DevicesService(_authenticationToken, new HttpWrapper());

            // Act
            var stationDetails = devicesService.Get().Result;

            // Arrange
            Assert.IsNotNull(stationDetails, "Station Details");
            Assert.IsNotNull(stationDetails.Modules, "Modules");
            Assert.IsNotNull(stationDetails.Devices, "Devices");
        }
Example #2
0
        public void GetMeasurements_ForModule(Type moduleType)
        {
            // Arrange
            var    measurementService = new MeasurementsService(_authenticationToken);
            string firstDevice        = _user.DeviceIds.First();

            var    devicesService = new DevicesService(_authenticationToken);
            var    stationDetails = devicesService.Get();
            Module module         = stationDetails.Modules.First(x => x.GetType() == moduleType);

            // Act
            List <SensorMeasurement> measurements = measurementService.Get(firstDevice, module);

            // Assert
            Assert.IsNotNull(measurements);
        }
        public void GetMeasurements_ForModule(Type moduleType)
        {
            // Arrange
            string firstDevice = _user.DeviceIds.First();

            // Get the (rain) module to look up measurements from.
            var    devicesService = new DevicesService(_authenticationToken, new HttpWrapper());
            var    stationDetails = devicesService.Get().Result;
            Module module         = stationDetails.Modules.First(x => x.GetType() == moduleType);

            var measurementService = new MeasurementsService(_authenticationToken, new HttpWrapper());

            // Act
            List <SensorMeasurement> measurements = measurementService.Get(firstDevice, module).Result;

            // Assert
            Assert.IsNotNull(measurements);
        }
 public ActionResult <List <Device> > Get()
 {
     return(_devicesService.Get());
 }