Exemplo n.º 1
0
        public void GetCarparks_ListOfCarParks_Returned()
        {
            A.CallTo(() => carParkRepository.GetCarParks()).Returns(carParkList);
            var SUT = new CarParkService(carParkRepository);

            var result = SUT.GetCarParks();

            Assert.Equal(carParkList.Count, result.Count);
        }
Exemplo n.º 2
0
        public ICollection <ICarPark> GetCarParks()
        {
            var carParks       = carParkRepository.GetCarParks();
            var listOfCarparks = new List <ICarPark>();

            foreach (var item in carParks)
            {
                listOfCarparks.Add(new CarPark(item.Id, item.AvailableSpaces));
            }
            return(listOfCarparks);
        }