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);
		}
Пример #3
0
        protected override IProductBuilderContributor InitContributor()
        {
            httpFileService         = MockRepository.GenerateStub <IHttpFileService>();
            productOrderableService = MockRepository.GenerateStub <IOrderableService <ProductImage> >();

            return(new Images(httpFileService, productOrderableService));
        }
Пример #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;
 }
Пример #5
0
        protected override IProductBuilderContributor InitContributor()
        {
            httpFileService = MockRepository.GenerateStub<IHttpFileService>();
            productOrderableService = MockRepository.GenerateStub<IOrderableService<ProductImage>>();

            return new Images(httpFileService, productOrderableService);
        }
Пример #6
0
		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;
		}
Пример #7
0
        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
                );
        }
Пример #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
                );
        }
Пример #10
0
 public Images(IHttpFileService httpFileService, IOrderableService<ProductImage> productOrderableService)
 {
     this.httpFileService = httpFileService;
     this.productOrderableService = productOrderableService;
 }
Пример #11
0
 public Images(IHttpFileService httpFileService, IOrderableService <ProductImage> productOrderableService)
 {
     this.httpFileService         = httpFileService;
     this.productOrderableService = productOrderableService;
 }