Exemplo n.º 1
0
        /// <summary>
        /// Constructor for this class.
        /// </summary>

        /// <param name="mapper">Used to map between domain classes and request/response/dto classes.</param>
        /// <param name="googleMapsApiService">Used to send requests to the Google Maps Api</param>
        /// <param name="priceStrategyFactory">Used to get the correct strategy for price calculations</param>
        /// <param name="unitOfWork">Used to access the database repositories</param>
        public RideService(
            IMapper mapper,
            IGoogleMapsApiService googleMapsApiService,
            IPriceStrategyFactory priceStrategyFactory,
            IUnitOfWork unitOfWork,
            IMatchService matchService)
        {
            _mapper = mapper;
            _googleMapsApiService = googleMapsApiService;
            _priceStrategyFactory = priceStrategyFactory;
            _unitOfWork           = unitOfWork;
            _matchService         = matchService;
        }
 public void Setup()
 {
     _mapper = Substitute.For <IMapper>();
     _googleMapsApiService    = Substitute.For <IGoogleMapsApiService>();
     _rideRepository          = Substitute.For <IRideRepository>();
     _soloRidePriceStrategy   = Substitute.For <IPriceStrategy>();
     _sharedRidePriceStrategy = Substitute.For <IPriceStrategy>();
     _priceStrategyFactory    = Substitute.For <IPriceStrategyFactory>();
     _unitOfWork    = Substitute.For <IUnitOfWork>();
     _matchService  = Substitute.For <IMatchService>();
     _rideService   = new RideService(_mapper, _googleMapsApiService, _priceStrategyFactory, _unitOfWork, _matchService);
     _anAddress     = new Address("city", 1000, "street", 1);
     _anAddress.Lat = 10;
     _anAddress.Lng = 10;
 }
Exemplo n.º 3
0
 public StoreController(StoreContext context, IPriceStrategyFactory factory)
 {
     _context = context;
     _factory = factory;
 }