public void Init()
        {
            this.ConfigureMapper();
            this.cars = new List <Car>()
            {
                new Car()
                {
                    Id    = 1,
                    Price = 20,
                    Name  = "Volga"
                },
                new Car()
                {
                    Id    = 2,
                    Price = 30,
                    Name  = "Chaika"
                }
            };

            this._context = new FakeCarsDbContext();
            foreach (var car in cars)
            {
                this._context.Cars.Add(car);
            }

            HttpConfiguration config = new HttpConfiguration();

            this._service    = new CarsService(this._context);
            this._controller = new CarsController(this._service);
            this._controller.Configuration = config;
        }
예제 #2
0
        public UnitOfWork(ICarsDbContext dbContext)
        {
            if (dbContext == null)
            {
                throw new ArgumentNullException("Db context cannot be null");
            }

            this.dbContext = dbContext;
        }
예제 #3
0
        public Repository(ICarsDbContext dbContext)
        {
            if (dbContext == null)
            {
                throw new ArgumentNullException("Db context cannot be null.");
            }

            this.dbContext = dbContext;
        }
 public Service(ICarsDbContext context)
 {
     this.Context = context;
 }
예제 #5
0
 public QueryXmlParser(ICarsDbContext carsContext)
 {
     this.carsContext = carsContext;
 }
예제 #6
0
 public DataJsonImporter(ICarsDbContext carsContext)
 {
     this._carsContext = carsContext;
 }
 public CarsService(ICarsDbContext cars)
     : base(cars)
 {
 }