Beispiel #1
0
        public void GetStationsByDistanceReturnsAStationCollection()
        {
            List <string> fakeLines = new List <string>(new string[] { "Test", "Test2" });

            Station fakeStation = new Station("fakeId", "fakeName", 0L, 0L, fakeLines);

            List <Station> mockedList = new List <Station>(new Station[] { fakeStation });

            _mockStationProvider.Expects.One.Method(_ => _.GetStationsByDistance(0))
            .With(300)
            .WillReturn(mockedList);

            MetroMobilite test = new MetroMobilite(_mockStationProvider.MockObject);

            Assert.AreEqual(test.GetStationsByDist(300), mockedList);
        }
Beispiel #2
0
        public void GetStationsReturnsStationDictionary()
        {
            List <string> fakeLines = new List <string>(new string[] { "Test", "Test2" });

            Station fakeStation = new Station("fakeId", "fakeName", 0L, 0L, fakeLines);

            Dictionary <string, Station> mockedDictionary = new Dictionary <string, Station>();

            mockedDictionary.Add("fakeId", fakeStation);

            _mockStationProvider.Expects.One.Method(_ => _.GetStations(0)).With(0)
            .WillReturn(mockedDictionary);

            MetroMobilite test = new MetroMobilite(_mockStationProvider.MockObject);

            Assert.AreEqual(test.GetStations(0), mockedDictionary);
        }