private async Task <IEnumerable <Domain.Entities.Thermostat> > Parse(object json) { if (_settings.StoreResponse) { await _eventLogRepository.Add(new EventLog( "Ecobee", _settings.ThermostatUri, "ResponseBody", DateTime.UtcNow, _request.CorrelationId, entityObject : json)); } return(ThermostatListParser.Parse(json)); }
public void Should_ParseTermostatList() { var data = File.ReadAllText(FilePath); var json = JsonConvert.DeserializeObject(data); var thermostats = ThermostatListParser.Parse(json).ToList(); thermostats.ElementAt(0).Reading.TemperatureInF.Should().Be(769); thermostats.ElementAt(0).Settings.HeatRangeHigh.Should().Be(790); thermostats.ElementAt(0).Scenes.ElementAt(0).Name.Should().Be("home"); }