public CategoryController(IRepository<Category> categoryRepository, IOrderableService<Category> orderableService, IHttpFileService httpFileService, IRepository<Image> imageRepository)
 {
     this.categoryRepository = categoryRepository;
 	this.imageRepository = imageRepository;
 	this.httpFileService = httpFileService;
 	this.orderableService = orderableService;
 }
		public void Setup()
		{
			products= new List<Product>();
			images = new List<Image>();
			validator = MockRepository.GenerateStub<IValidatingBinder>();
			repository = MockRepository.GenerateStub<IRepository<Product>>();
			repository.Expect(x => x.GetAll()).Return(products.AsQueryable());
			fileService = MockRepository.GenerateStub<IHttpFileService>();
			imageOrderableService = MockRepository.GenerateStub<IOrderableService<ProductImage>>();
			fileService.Expect(x => x.GetUploadedImages(null)).IgnoreArguments().Return(images);
			sizeService = MockRepository.GenerateStub<ISizeService>();
			
			var resolver = MockRepository.GenerateStub<IRepositoryResolver>();
			
			controllerContext = new ControllerContext()
			{
				HttpContext = MockRepository.GenerateStub<HttpContextBase>()
			};

			controllerContext.HttpContext.Stub(x => x.Request).Return(MockRepository.GenerateStub<HttpRequestBase>());
			sizeService.Expect(x => x.WithValues(controllerContext.HttpContext.Request.Form)).Return(sizeService);

			valueProvider = new FakeValueProvider();
			bindingContext = new ModelBindingContext() 
			{
				ModelState = new ModelStateDictionary(),
                ModelMetadata = ModelMetadataProviders.Current.GetMetadataForType(null, typeof(Product)),
				ModelName = "product",
				ValueProvider = valueProvider
			};

			binder = new ProductBinder(validator, resolver, repository, fileService, imageOrderableService, sizeService);
		}
Beispiel #3
0
        protected override IProductBuilderContributor InitContributor()
        {
            httpFileService         = MockRepository.GenerateStub <IHttpFileService>();
            productOrderableService = MockRepository.GenerateStub <IOrderableService <ProductImage> >();

            return(new Images(httpFileService, productOrderableService));
        }
Beispiel #4
0
 public CategoryController(IRepository <Category> categoryRepository, IOrderableService <Category> orderableService, IHttpFileService httpFileService, IRepository <Image> imageRepository)
 {
     this.categoryRepository = categoryRepository;
     this.imageRepository    = imageRepository;
     this.httpFileService    = httpFileService;
     this.orderableService   = orderableService;
 }
        protected override IProductBuilderContributor InitContributor()
        {
            httpFileService = MockRepository.GenerateStub<IHttpFileService>();
            productOrderableService = MockRepository.GenerateStub<IOrderableService<ProductImage>>();

            return new Images(httpFileService, productOrderableService);
        }
		public ProductBinder(IValidatingBinder validatingBinder, IRepositoryResolver resolver, IRepository<Product> repository, IHttpFileService httpFileService, IOrderableService<ProductImage> orderableService, ISizeService sizeService)
			: base(validatingBinder, resolver)
		{
			this.repository = repository;
			this.httpFileService = httpFileService;
			this.orderableService = orderableService;
			this.sizeService = sizeService;
		}
        public VKAudioInfoViewModel(
            IHttpFileService httpFileService,
            IImagesCacheService imagesCacheService)
        {
            _httpFileService    = httpFileService;
            _imagesCacheService = imagesCacheService;

            ReloadInfoCommand = new DelegateCommand(LoadTrackInfo);
        }
        public void SetUp()
        {
            categoryRepository = MockRepositoryBuilder.CreateCategoryRepository();
            orderableService = MockRepository.GenerateStub<IOrderableService<Category>>();
			fileService = MockRepository.GenerateStub<IHttpFileService>();
			imageRepository = MockRepository.GenerateStub<IRepository<Image>>();

            categoryController = new CategoryController(
                categoryRepository, 
                orderableService, 
				fileService,
				imageRepository
                );
        }
Beispiel #9
0
        public void SetUp()
        {
            categoryRepository = MockRepositoryBuilder.CreateCategoryRepository();
            orderableService   = MockRepository.GenerateStub <IOrderableService <Category> >();
            fileService        = MockRepository.GenerateStub <IHttpFileService>();
            imageRepository    = MockRepository.GenerateStub <IRepository <Image> >();

            categoryController = new CategoryController(
                categoryRepository,
                orderableService,
                fileService,
                imageRepository
                );
        }
Beispiel #10
0
 public Images(IHttpFileService httpFileService, IOrderableService<ProductImage> productOrderableService)
 {
     this.httpFileService = httpFileService;
     this.productOrderableService = productOrderableService;
 }
Beispiel #11
0
 public Images(IHttpFileService httpFileService, IOrderableService <ProductImage> productOrderableService)
 {
     this.httpFileService         = httpFileService;
     this.productOrderableService = productOrderableService;
 }