public PackageService(
     ICryptographyService cryptoSvc,
     IEntityRepository<PackageRegistration> packageRegistrationRepo,
     IEntityRepository<Package> packageRepo,
     IPackageFileService packageFileSvc,
     IEntityRepository<PackageOwnerRequest> packageOwnerRequestRepository,
     IEntityRepository<PackageAuthor> packageAuthorRepo,
     IEntityRepository<PackageFramework> packageFrameworksRepo,
     IEntityRepository<PackageDependency> packageDependenciesRepo,
     IEntityRepository<PackageFile> packageFilesRepo,
     IEntityRepository<ScanResult> scanResultRepo, 
     IMessageService messageSvc,
     IImageFileService imageFileSvc,
     IIndexingService indexingSvc,
     IPackageStatisticsService packageStatsSvc)
 {
     this.cryptoSvc = cryptoSvc;
     this.packageRegistrationRepo = packageRegistrationRepo;
     this.packageRepo = packageRepo;
     this.packageFileSvc = packageFileSvc;
     this.packageOwnerRequestRepository = packageOwnerRequestRepository;
     this.packageAuthorRepo = packageAuthorRepo;
     this.packageFrameworksRepo = packageFrameworksRepo;
     this.packageDependenciesRepo = packageDependenciesRepo;
     this.packageFilesRepo = packageFilesRepo;
     this.scanResultRepo = scanResultRepo;
     this.messageSvc = messageSvc;
     this.imageFileSvc = imageFileSvc;
     this.indexingSvc = indexingSvc;
     this.packageStatsSvc = packageStatsSvc;
 }
示例#2
0
 private void CreateServices()
 {
     var connectionStringProvider = new ConnectionStringProvider("Data Source=.\\SQLEXPRESS;Initial Catalog=JumpTheGun;Integrated Security=True");
     var dataContextProvider = new DataContextProvider(connectionStringProvider);
     this.contentRepository = new Repository<Content>(dataContextProvider);
     this.userRepository = new Repository<User>(dataContextProvider);
     var categoryRepository = new Repository<Suteki.Shop.Category>(dataContextProvider);
     this.contentOrderableService = new OrderableService<Content>(contentRepository);
     this.baseControllerService = new BaseControllerService(categoryRepository);
     this.imageFileService = new ImageFileService();
 }
示例#3
0
        private void CreateServices()
        {
            var iocContainer = GetIocContainer();

            contentRepository = iocContainer.Resolve<IRepository<Content>>();
            menuRepository = iocContainer.Resolve<IRepository<Menu>>();
            userRepository = iocContainer.Resolve<IRepository<User>>();
            contentOrderableService = iocContainer.Resolve<IOrderableService<Content>>();
            baseControllerService = iocContainer.Resolve<IBaseControllerService>();
            imageFileService = iocContainer.Resolve<IImageFileService>();
            unitOfWorkManager = iocContainer.Resolve<IUnitOfWorkManager>();
        }
        public void SetUp()
        {
            contentRepository = MockRepository.GenerateStub<IRepository<Content>>();
            contentOrderableService = MockRepository.GenerateStub<IOrderableService<Content>>();
            baseControllerService = MockRepository.GenerateStub<IBaseControllerService>();
            imageFileService = MockRepository.GenerateStub<IImageFileService>();
            userService = MockRepository.GenerateStub<IUserService>();

            metaWeblog = new MetaWeblogWcf(
                userService,
                contentRepository,
                baseControllerService,
                contentOrderableService,
                imageFileService);

            var url = "http://localhost:27198/MetaWeblogTest.svc";

            baseControllerService.Stub(s => s.SiteUrl).Return(theSiteUrl);
            userService.Stub(s => s.Authenticate(Arg<string>.Is.Anything, Arg<string>.Is.Anything)).Return(true);
            var user = new User
            {
                RoleId = Role.AdministratorId
            };
            userService.Stub(s => s.CurrentUser).Return(user);


            container = new WindsorContainer()
                .AddFacility<WcfFacility>(f => f.DefaultBinding = new XmlRpcHttpBinding())
                .Register(
                    Component.For<XmlRpcEndpointBehavior>(),
                    Component.For<IMetaWeblog>().Instance(metaWeblog)
                        .ActAs(new DefaultServiceModel()
                            .AddBaseAddresses(url)
                            .AddEndpoints(
                                WcfEndpoint.ForContract<IMetaWeblog>()
                            )

                        )
                    );

            //var targetUrl = url;
            var targetUrl = "http://ipv4.fiddler:27198/MetaWeblogTest.svc";
            var factory = new XmlRpcChannelFactory<IMetaWeblog>(new XmlRpcHttpBinding(), new EndpointAddress(targetUrl));
            client = factory.CreateChannel();

            // diagnostics
            var traceListener = new XmlWriterTraceListener("app_tracelog.svclog")
            {
                TraceOutputOptions = TraceOptions.Timestamp
            };
            Trace.Listeners.Add(traceListener);
        }
示例#5
0
 public MetaWeblogWcf(
     IUserService userService, 
     IRepository<Content> contentRepository, 
     IBaseControllerService baseControllerService, 
     IOrderableService<Content> contentOrderableService, 
     IImageFileService imageFileService)
 {
     this.userService = userService;
     this.imageFileService = imageFileService;
     this.contentOrderableService = contentOrderableService;
     this.baseControllerService = baseControllerService;
     this.contentRepository = contentRepository;
 }
示例#6
0
 public MetaWeblog(
     IRepository<Content> contentRepository,
     IRepository<Menu> menuRepository,
     IRepository<User> userRepository,
     IOrderableService<Content> contentOrderableService,
     IBaseControllerService baseControllerService,
     IImageFileService imageFileService)
 {
     this.contentRepository = contentRepository;
     this.menuRepository = menuRepository;
     this.userRepository = userRepository;
     this.contentOrderableService = contentOrderableService;
     this.baseControllerService = baseControllerService;
     this.imageFileService = imageFileService;
 }
 public HttpFileService(IImageFileService imageFileService, IImageService imageService)
 {
     this.imageFileService = imageFileService;
     this.imageService = imageService;
 }
示例#8
0
 public ImageService(IImageFileService imageFileService, ImageDefinition[] imageDefinitions)
 {
     this.imageFileService = imageFileService;
 	this.imageDefinitions = imageDefinitions;
 }