示例#1
0
        public void GetAllStations_NoStations_ReturnsEmptyList()
        {
            UnitTestStationInformationLoader loader = new UnitTestStationInformationLoader();

            Stations stations = new Stations(loader);

            Assert.IsType <List <Station> >(stations.GetAllStations());
            Assert.Empty(stations.GetAllStations());
        }
示例#2
0
        public void GetAllStations_ReturnOnlyThoseInUse_OneStationInUse_TwoStationsNotInUse_ReturnsOneStation()
        {
            UnitTestStationInformationLoader loader = new UnitTestStationInformationLoader();

            loader.AddStations(
                new Station()
            {
                Abbreviation = "STS", IsInUse = false
            },
                new Station()
            {
                Abbreviation = "SAN", IsInUse = true
            },
                new Station()
            {
                Abbreviation = "HAR", IsInUse = false
            });

            Stations stations = new Stations(loader);

            var result = stations.GetAllStations();

            Assert.IsType <List <Station> >(result);
            Assert.Single(result);
        }
示例#3
0
        public void GetAllStations_DontReturnOnlyThoseInUse_OneStationNotInUse_ReturnsEmptyList()
        {
            UnitTestStationInformationLoader loader = new UnitTestStationInformationLoader();

            loader.AddStations(new Station()
            {
                Abbreviation = "STS", IsInUse = false
            });

            Stations stations = new Stations(loader);

            var result = stations.GetAllStations(returnOnlyStationsInUse: false);

            Assert.IsType <List <Station> >(result);
            Assert.Single(result);
        }
示例#4
0
        public void GetAllStations_OneStation_ReturnsListWithOneItem()
        {
            UnitTestStationInformationLoader loader = new UnitTestStationInformationLoader();

            loader.AddStations(new Station()
            {
                Abbreviation = "STS", IsInUse = true
            });

            Stations stations = new Stations(loader);

            var result = stations.GetAllStations();

            Assert.IsType <List <Station> >(result);
            Assert.Single(result);
        }
示例#5
0
 public List <Stations> GetAllStation(String line)
 {
     return(station.GetAllStations(line));
 }