Beispiel #1
0
        public void DelaysServiceLoadsDefaultDelayMinutesThreshold()
        {
            var service = new DelaysService(
                A.Fake <ILogger <DelaysService> >(),
                A.Fake <IStationBoardService>(),
                A.Fake <ICrsService>(),
                A.Fake <IConfiguration>(),
                A.Fake <IDateTimeService>());

            Assert.Equal(5, service.DelayMinutesThreshold);
        }
Beispiel #2
0
        public async Task DelaysServiceReturnsDelaysResponse()
        {
            var service = new DelaysService(
                A.Fake <ILogger <DelaysService> >(),
                A.Fake <IStationBoardService>(),
                A.Fake <ICrsService>(),
                A.Fake <IConfiguration>(),
                A.Fake <IDateTimeService>());

            var response = await service.GetDelaysAsync(new StationBoardRequest());

            Assert.NotNull(response);
        }
Beispiel #3
0
        public void DelaysServiceLoadsDelayMinutesThreshold()
        {
            var config = A.Fake <IConfiguration>();

            config["DelayMinutesThreshold"] = "7";

            var service = new DelaysService(
                A.Fake <ILogger <DelaysService> >(),
                A.Fake <IStationBoardService>(),
                A.Fake <ICrsService>(),
                config,
                A.Fake <IDateTimeService>()
                );

            Assert.Equal(7, service.DelayMinutesThreshold);
        }
Beispiel #4
0
        public async Task DelaysServiceReturnsDelaysResponseWithLateTrains()
        {
            var service = new DelaysService(
                A.Fake <ILogger <DelaysService> >(),
                A.Fake <IStationBoardService>(),
                A.Fake <ICrsService>(),
                A.Fake <IConfiguration>(),
                A.Fake <IDateTimeService>());

            var request = new StationBoardRequest
            {
                Crs        = "ABC",
                FilterType = FilterType.to,
                FilterCrs  = "XYZ",
                NumRows    = 5,
            };

            var response = await service.GetDelaysAsync(request);

            Assert.NotNull(response);
        }