public void TestInitialize()
        {
            _busStation = new MasterBusStation
            {
                BusStationId    = 1,
                BusStationName  = "A",
                BusStationRoute = "B"
            };

            _busStations = new List <MasterBusStation>
            {
                _busStation
            };

            _mockAsyncRepository = new Mock <IAsyncRepository <MasterBusStation> >();

            _mockAsyncRepository
            .Setup(x => x.GetAllAsync())
            .ReturnsAsync(_busStations);

            _mockAsyncRepository
            .Setup(x => x.GetByIdAsync(It.IsAny <int>()))
            .ReturnsAsync(_busStation);

            _busStationService = new BusStationService(_mockAsyncRepository.Object);
        }
예제 #2
0
        public async Task AddAsync(BusStationModel model)
        {
            var busStation = new MasterBusStation
            {
                RouteId        = model.RouteId,
                BusStationName = model.BusStationName,
                BusStationCode = model.BusStationCode,
                TimeInDay      = model.TimeInDay,
                TimeInNight    = model.TimeInNight,
            };

            await _repository.AddAsync(busStation);
        }