Beispiel #1
0
 public Worker(ILogger <Worker> logger, IAmqpService service, IScooterService service1, ISensorService service2)
 {
     _logger         = logger;
     _service        = service;
     _serviceScooter = service1;
     _serviceSensor  = service2;
 }
 public ScenarioHelper(ICarService carService, IDriverService driverService, IScooterService scooterService, IRentalService rentalService)
 {
     this._driverService  = driverService;
     this._carService     = carService;
     this._rentalService  = rentalService;
     this._scooterService = scooterService;
 }
Beispiel #3
0
 public RentalCompany(string name, IScooterService scooterService, IRentalPriceCalculator rentalPriceCalculator,
                      IList <RentedScooter> rentals)
 {
     Name                   = name;
     _scooterService        = scooterService;
     _rentedScooters        = rentals;
     _rentalPriceCalculator = rentalPriceCalculator;
 }
Beispiel #4
0
 public RentalCompany(string name, IScooterService scooterService, IRentCalculator calculator,
                      IRideService rideService)
 {
     Name            = name;
     _calculator     = calculator;
     _scooterService = scooterService;
     _rideService    = rideService;
 }
Beispiel #5
0
 public RentalCompany(string name, IScooterService scooterService, ICalculations calculations)
 {
     Name           = name;
     ScooterService = scooterService;
     Calculations   = calculations;
     RentHistory    = new List <RentedUnit>();
     _transId       = 0;
 }
 public RentalCompany(string name,
                      IRentalService rentalService,
                      IScooterService scooterService,
                      IRentalCalculator rentalCalculator)
 {
     Name              = name;
     _rentalService    = rentalService;
     _scooterService   = scooterService;
     _rentalCalculator = rentalCalculator;
 }
        public SimpleTestContainer()
        {
            // domain event publisher
            var domainEventPublisher = new SimpleEventPublisher();

            // infrastructure service
            var emaildispatcher = new EmailDispatcher();

            // event listeners
            var driverCreatedEventListener = new DriverCreatedEventListener();

            domainEventPublisher.Subscribe <DriverCreatedEvent>(driverCreatedEventListener);

            //unitOfWork
            var unitOfWork = new MemoryCarRentalUnitOfWork(
                new MemoryRepository <Driver>(),
                new MemoryRepository <Car>(),
                new MemoryRepository <Rental>(),
                new MemoryRepository <Scooter>());

            // factories
            var rentalFactory      = new RentalFactory(domainEventPublisher);
            var carFactory         = new CarFactory(domainEventPublisher);
            var freeMinutesFactory = new FreeMinutesFactory();

            // mappers
            var carMapper     = new CarMapper();
            var driverMapper  = new DriverMapper();
            var scooterMapper = new ScooterMapper();
            var rentalMapper  = new RentalMapper();

            this.CarService = new CarService(
                unitOfWork,
                carMapper,
                domainEventPublisher);

            this.ScooterService = new ScooterService(
                unitOfWork,
                scooterMapper,
                domainEventPublisher);

            this.DriverService = new DriverService(
                unitOfWork,
                driverMapper,
                domainEventPublisher);

            this.RentalService = new RentalService(
                unitOfWork,
                rentalFactory,
                rentalMapper,
                freeMinutesFactory,
                domainEventPublisher);
        }
Beispiel #8
0
 public void Setup()
 {
     ScooterService = new ScooterService();
 }
Beispiel #9
0
        public ScooterServiceTests()
        {
            var mockLogger = new Mock <ILogger <ScooterService> >();

            _scooterService = new ScooterService(mockLogger.Object);
        }
Beispiel #10
0
 public ScooterController(IScooterService scooterService)
 {
     _scooterService = scooterService;
 }
Beispiel #11
0
 public void Initialize()
 {
     _scooterService = new ScooterService();
 }
 public void Setup()
 {
     ScooterService = new ScooterService();
     RentalCompany  = new RentalCompany(ScooterService);
 }
 public RentalCompany(ILogger <RentalCompany> logger, IScooterService scooterService, string name)
 {
     _logger         = logger ?? throw new ArgumentNullException(nameof(logger));
     _scooterService = scooterService ?? throw new ArgumentNullException(nameof(scooterService));
     _name           = name ?? throw new ArgumentNullException(nameof(name));
 }
Beispiel #14
0
 public ScooterFunctions(IScooterService scooterService)
 {
     _scooterService = scooterService;
 }
Beispiel #15
0
 public ScooterServiceTests()
 {
     service = new ScooterService();
 }
 public ScooterController(ILogger <ScooterController> logger, IScooterService scooterService)
 {
     _logger         = logger;
     _scooterService = scooterService;
 }
Beispiel #17
0
 public Calculations(decimal priceCap, IScooterService scooterService)
 {
     _priceCap      = priceCap;
     ScooterService = scooterService;
 }
Beispiel #18
0
 /**
  * Compatibile con vers. 0.9.1 (RabbitMQ)
  */
 public AmqpService(string endpoint, IScooterService service, ISensorService service1)
 {
     this.endpoint   = endpoint;
     _serviceScooter = service;
     _serviceSensor  = service1;
 }
Beispiel #19
0
 public RentalCompany(IScooterService scooterService)
 {
     ScooterService = scooterService;
     rentRepository = new MockRepository <Rent>();
 }
Beispiel #20
0
 public ScooterUpdated(IScooterService scooterService)
 {
     _scooterService = scooterService;
 }
Beispiel #21
0
 public ScooterServiceTests()
 {
     _scooterService = new ScooterService(_scooterRepositoryMock.Object);
 }