private void SetDependencies <T>(T vehicle)
 {
     userDialogsManager = ConfigureDependencies().Resolve <IUserDialogsHelper>();
     userDialogsManager.UserDialogsInit(this);
     if (vehicle.GetType() == typeof(Car))
     {
         carServiceDomain = ConfigureDependencies().Resolve <CarServiceDomain>();
     }
     if (vehicle.GetType() == typeof(Motorcycle))
     {
         motorcycleServiceDomain = ConfigureDependencies().Resolve <MotorcycleServiceDomain>();
     }
 }
        public void CarServiceDomainSaveCarTest()
        {
            //Arrange
            SetDependencies();
            Car car = new Car(defaultCarId, defaultDate);
            CarServiceDomain carServiceDomain = new CarServiceDomain(carDao);
            int actualCars = carDao.GetAllVehicles().Count;

            //Act
            carServiceDomain.SaveVechicleOnDb(car);

            //Assert
            Assert.Equal(actualCars + 1, carDao.GetAllVehicles().Count);
        }
 private void SetDependencies()
 {
     carServiceDomain        = ConfigureDependencies().Resolve <CarServiceDomain>();
     motorcycleServiceDomain = ConfigureDependencies().Resolve <MotorcycleServiceDomain>();
 }
예제 #4
0
 private void SetDependencies()
 {
     carServiceDomain   = ConfigureDependencies().Resolve <CarServiceDomain>();
     userDialogsManager = ConfigureDependencies().Resolve <IUserDialogsHelper>();
     userDialogsManager.UserDialogsInit(this);
 }