// Setup
        public TestTankRepository()
        {
            connection = new SqliteConnection("DataSource=:memory:");
            connection.Open();
            var options = new DbContextOptionsBuilder <RobotStoreContext>()
                          .UseSqlite(connection).Options;

            context = new RobotStoreContext(options);
            context.Database.EnsureCreated();
            repository = new TankRepository(context);
        }
예제 #2
0
 public TankController(ITankRepository tankRepository, IMapper mapper, IPropertyMappingService propertyMappingService,
                       IPropertyCheckerService propertyCheckerService)
 {
     _tankRepository = tankRepository ??
                       throw new ArgumentNullException(nameof(tankRepository));
     _mapper = mapper ??
               throw new ArgumentNullException(nameof(mapper));
     _propertyMappingService = propertyMappingService ??
                               throw new ArgumentNullException(nameof(propertyMappingService));
     _propertyCheckerService = propertyCheckerService ??
                               throw new ArgumentNullException(nameof(propertyCheckerService));
 }
 public OldFactoryService()
 {
     _tankRepository = new TankRepository();
 }
예제 #4
0
 public TankService()
 {
     this._tankRepository = new TankRepository();
 }