public JsonResult <StationIdsResponse> Get()
        {
            var stationIds = _repository.GetStationIds();

            var data = new StationIdsResponse(stationIds);

            return(ToJson(data));
        }
Example #2
0
        public void Get_stationIds()
        {
            _repository.Save(CreateDataPoint("s1"));
            _repository.Save(CreateDataPoint("s1"));
            _repository.Save(CreateDataPoint("s2"));

            var stationIds = _repository.GetStationIds();

            stationIds.Should().Equal(new List <string> {
                "s1", "s2"
            });
        }
Example #3
0
        //GET: Home
        public ActionResult Details(string stationId, string lastHours = "24")
        {
            //var dateTimeRange = DateTimeRange.Create(startDateTime, endDateTime);
            var dateTimeRange = CreateDateTimeRange(lastHours);


            var stationIds = _repository.GetStationIds();

            stationId = TryGetStationId(stationIds, stationId);

            var model = new StationDetailsModel
            {
                AllStationIds    = stationIds,
                StationId        = stationId,
                ChartHtmlList    = CreateChartHtmlList(stationId, dateTimeRange),
                LatestDataPoints = GetLatestDataPoints(stationId)
            };

            return(View(model));
        }