コード例 #1
0
        public void SchaffnerService_Stop1_GetAllPredictions_ReturnsAppropriatePredictions()
        {
            var cndctr = Substitute.For <IConductorService>();

            var           fix    = new Fixture();
            IList <Route> routes = new List <Route>()
            {
                new Route(1, "testRoute1"), new Route(2, "testRoute2"), new Route(3, "testRoute3")
            };
            IList <Stop> stops = new List <Stop>()
            {
                new Stop(1, "testStop1"), new Stop(2, "testStop2"), new Stop(3, "testStop3")
            };

            IBusSystemDataSource dataSource = Substitute.For <IBusSystemDataSource>();

            dataSource.Routes.Returns(routes);
            dataSource.Stops.Returns(stops);

            var repo = new BusSystemRepository(dataSource);

            ITransportationTimeTableService sc = new TransportationTimeTableService(repo, cndctr);

            IEnumerable <IStopPrediction> preds = sc.GetAllStopPredictions(2, DateTime.Now);

            Assert.Equal(3, preds.Count());
        }
コード例 #2
0
        public void SchaffnerService_HappyPath()
        {
            var cndctr = Substitute.For <IConductorService>();
            var repo   = Substitute.For <IBusSystemRepository>();

            ITransportationTimeTableService sc = new TransportationTimeTableService(repo, cndctr);
        }
コード例 #3
0
        public void SchaffnerService_Builds_TimesTable_HappyPath()
        {
            var cndctr = Substitute.For <IConductorService>();

            var           fix    = new Fixture();
            IList <Route> routes = new List <Route>()
            {
                new Route(1, "testRoute1"), new Route(2, "testRoute2"), new Route(3, "testRoute3")
            };
            IList <Stop> stops = new List <Stop>()
            {
                new Stop(1, "testStop1"), new Stop(2, "testStop2"), new Stop(3, "testStop3")
            };

            IBusSystemDataSource dataSource = Substitute.For <IBusSystemDataSource>();

            dataSource.Routes.Returns(routes);
            dataSource.Stops.Returns(stops);

            var repo = new BusSystemRepository(dataSource);

            ITransportationTimeTableService sc = new TransportationTimeTableService(repo, cndctr);
        }