public LicenseValidationMiddleware(OwinMiddleware next, ILicenseValidation licenseValidation, ITruckService truckService)
     : base(next)
 {
     _licenseValidation = licenseValidation;
     _truckService      = truckService;
     _userRepository    = new UserRepository(new DatabaseFactory());
 }
Exemplo n.º 2
0
 public ScheduleController(IRepository repository, IScheduleService schedService, ITruckService truckService, IMappingEngine mapper)
 {
     this.repository = repository;
     this.schedService = schedService;
     this.truckService = truckService;
     this.mapper = mapper;
 }
Exemplo n.º 3
0
 public TrucksController(
     ILogger <TrucksController> logger,
     ITruckService truckService)
 {
     Logger       = logger;
     TruckService = truckService;
 }
Exemplo n.º 4
0
        public void TestInitialize()
        {
            FakeUnitOfWork = new FakeUnitOfWork();

            Mapper = new Mapper(new MapperConfiguration(c => c.AddProfile(new MappingProfile())));

            TruckService = new TruckService(FakeUnitOfWork, Mapper);
        }
Exemplo n.º 5
0
 public TruckController(ITruckService truckService,
                        ICommonService commonService,
                        IInspectionDetailService inspectionDetailService,
                        IMaintenancePlanDetailService maintenancePlanDetailService,
                        IInspectionPlanDetailService inspectionPlanDetailService
                        )
 {
     this._truckService            = truckService;
     _commonService                = commonService;
     _inspectionDetailService      = inspectionDetailService;
     _inspectionPlanDetailService  = inspectionPlanDetailService;
     _maintenancePlanDetailService = maintenancePlanDetailService;
 }
Exemplo n.º 6
0
        public DataService(ICarService carService, ITruckService truckService)
        {
            CarService   = (CarService)carService;
            TruckService = (TruckService)truckService;

            foreach (var c in GetType().GetProperties())
            {
                var obj  = c.GetValue(this, null);
                var type = obj.GetType();
                var info = type.GetProperty("Client");
                info?.SetValue(obj, new HttpClient {
                    BaseAddress = new Uri("http://192.168.2.200:5000/api/")
                });
            }
        }
Exemplo n.º 7
0
 public ResultsController(
     ICourseService courseService,
     IDriverService driverService,
     ITruckService truckService,
     IFirmService firmService,
     IAsphaltBaseService asphaltBaseService,
     IAsphaltMixtureService asphaltMixtureService,
     IRoadObjectService roadObjectService)
 {
     this.courseService         = courseService;
     this.driverService         = driverService;
     this.truckService          = truckService;
     this.firmService           = firmService;
     this.asphaltBaseService    = asphaltBaseService;
     this.asphaltMixtureService = asphaltMixtureService;
     this.roadObjectService     = roadObjectService;
 }
Exemplo n.º 8
0
        public void TruckServiceModelFunctions()
        {
            ITruckService _service = serviceProvider.GetService <ITruckService>();

            // Validating pre-populated models
            List <TruckModel> models = _service.ListModels();

            Assert.NotNull(models);
            Assert.AreEqual(4, models.Count);

            TruckModel model1 = _service.FindModelById(1);

            Assert.NotNull(model1);
            Assert.AreEqual(1, model1.TruckModelId);
            Assert.AreEqual("FH", model1.Model);
            Assert.AreEqual(true, model1.Available);

            TruckModel model2 = _service.FindModelById(2);

            Assert.NotNull(model2);
            Assert.AreEqual(2, model2.TruckModelId);
            Assert.AreEqual("FM", model2.Model);
            Assert.AreEqual(true, model2.Available);

            TruckModel model3 = _service.FindModelById(3);

            Assert.NotNull(model3);
            Assert.AreEqual(3, model3.TruckModelId);
            Assert.AreEqual("FMX", model3.Model);
            Assert.AreEqual(false, model3.Available);

            TruckModel model4 = _service.FindModelById(4);

            Assert.NotNull(model4);
            Assert.AreEqual(4, model4.TruckModelId);
            Assert.AreEqual("VM", model4.Model);
            Assert.AreEqual(false, model4.Available);

            List <TruckModel> availableModels = _service.ListAvailableModels();

            Assert.NotNull(availableModels);
            availableModels.ForEach(m => {
                Assert.AreEqual(true, m.Available);
            });
        }
Exemplo n.º 9
0
 public AdminController(ITruckService truckService, IMappingEngine mapper)
 {
     this.truckService = truckService;
     this.mapper = mapper;
 }
Exemplo n.º 10
0
 public ScheduleService(IRepository repo, ITruckService truckService)
 {
     this.repository = repo;
     this.truckService = truckService;
 }
 public ApplicationLicenseController(ILicenseValidation licenseValidation, ITruckService truckService)
 {
     this._licenseValidation = licenseValidation;
     this._truckService      = truckService;
 }
 public TruckController(IUnitOfWork unitOfWork, ITruckService truckService, IModelService modelService) : base(unitOfWork)
 {
     _truckService = truckService;
     _modelService = modelService;
 }
Exemplo n.º 13
0
        public void TruckServiceFunctions()
        {
            ITruckService _service = serviceProvider.GetService <ITruckService>();

            List <TruckModel> models = _service.ListAvailableModels();

            Assert.NotNull(models);
            Assert.AreEqual(2, models.Count);
            // Get first available model
            var model = models[0];

            // Saving new Truck with specific information
            Truck truck = new Truck()
            {
                Description       = "TEST",
                ManufacturingYear = 1944,
                ModelYear         = 1944,
                Model             = model,
                TruckModelId      = model.TruckModelId
            };

            List <Truck> receivedTrucks = _service.ListAllTrucks();
            List <Truck> filtered       = receivedTrucks.Where(t => t.ManufacturingYear == 1944 || t.ModelYear == 1944).ToList();

            Assert.AreEqual(0, filtered.Count);

            _service.SaveOrUpdateTruck(truck);

            receivedTrucks = _service.ListAllTrucks();
            filtered       = receivedTrucks.Where(t => t.ManufacturingYear == 1944 || t.ModelYear == 1944).ToList();

            Assert.AreEqual(1, filtered.Count);

            Truck saved = filtered[0];

            Assert.AreEqual(1944, saved.ManufacturingYear);
            Assert.AreEqual(1944, saved.ModelYear);
            Assert.AreEqual("TEST", saved.Description);

            int id = saved.TruckId;

            Truck toUpdate = _service.FindTruckById(id);

            Assert.NotNull(toUpdate);

            toUpdate.ModelYear = 1950;
            _service.SaveOrUpdateTruck(toUpdate);

            receivedTrucks = _service.ListAllTrucks();
            filtered       = receivedTrucks.Where(t => t.ManufacturingYear == 1944 && t.ModelYear == 1950).ToList();

            Assert.AreEqual(1, filtered.Count);

            Truck updated = filtered[0];

            Assert.AreEqual(1944, updated.ManufacturingYear);
            Assert.AreEqual(1950, updated.ModelYear);
            Assert.AreEqual("TEST", updated.Description);

            _service.DeleteTruck(id);

            receivedTrucks = _service.ListAllTrucks();
            filtered       = receivedTrucks.Where(t => t.ManufacturingYear == 1944 || t.ModelYear == 1950).ToList();

            Assert.AreEqual(0, filtered.Count);
        }
Exemplo n.º 14
0
        public void ServiceIsInjectableAndAvailable()
        {
            ITruckService _service = serviceProvider.GetService <ITruckService>();

            Assert.NotNull(_service);
        }
 public TrucksController(ITruckService truckService)
 {
     this.truckService = truckService;
 }
Exemplo n.º 16
0
 public TruckController(ITruckService truckService)
 {
     _truckService = truckService;
 }
Exemplo n.º 17
0
 public TrucksController(ITruckService service, IMappingEngine mapper)
 {
     this.service = service;
     this.mapper = mapper;
 }
Exemplo n.º 18
0
 public TrucksController(ITruckService service)
 {
     _service = service;
 }
Exemplo n.º 19
0
 public TruckManagementController(ITruckService truckService)
 {
     _truckService = truckService;
 }
Exemplo n.º 20
0
 public DataServices(ICarService carService, ITruckService truckService)
 {
     CarService   = (CarService)carService;
     TruckService = (TruckService)truckService;
 }
Exemplo n.º 21
0
 public FindTruckController(ITruckService truckService)
 {
     _truckService = truckService;
 }
Exemplo n.º 22
0
 public OutboundOrderController(IStockRepository stockRepository, IProductRepository productRepository, ITruckService truckService)
 {
     this.stockRepository   = stockRepository;
     this.productRepository = productRepository;
     this.truckService      = truckService;
 }