Ejemplo n.º 1
0
 public void DeployDependency(IPackageInfo resolvedPackage,
     IPackagePublisher publisher)
 {
     var source = resolvedPackage.Load();
     using (var packageStream = source.OpenStream())
         publisher.Publish(resolvedPackage.FullName + ".wrap", packageStream);
 }
Ejemplo n.º 2
0
 public PackagePublishingService(IPackagePublisher packagePublisher, IPackageUnpublisher packageUnpublisher,
     IWebFaultExceptionCreator webFaultExceptionCreator, IServiceInputValidator serviceInputValidator, ILogger logger)
     : base(webFaultExceptionCreator, logger)
 {
     _packagePublisher = packagePublisher;
     _packageUnpublisher = packageUnpublisher;
     _serviceInputValidator = serviceInputValidator;
 }
Ejemplo n.º 3
0
 public PackagePublishingService(IPackagePublisher packagePublisher, IPackageUnpublisher packageUnpublisher,
                                 IWebFaultExceptionCreator webFaultExceptionCreator, IServiceInputValidator serviceInputValidator, ILogger logger)
     : base(webFaultExceptionCreator, logger)
 {
     _packagePublisher      = packagePublisher;
     _packageUnpublisher    = packageUnpublisher;
     _serviceInputValidator = serviceInputValidator;
 }
Ejemplo n.º 4
0
        public void DeployDependency(IPackageInfo resolvedPackage,
                                     IPackagePublisher publisher)
        {
            var source = resolvedPackage.Load();

            if (source == null)
            {
                throw new InvalidPackageException("The package could not be opened.");
            }
            using (var packageStream = source.OpenStream())
                publisher.Publish(resolvedPackage.FullName + ".wrap", packageStream);
        }
Ejemplo n.º 5
0
        public void SetUp()
        {
            _mockedPackageRepository             = new Mock <IRepository <Package> >();
            _mockedPublishedPackageRepository    = new Mock <IRepository <PublishedPackage> >();
            _mockedPublishedScreenshotRepository = new Mock <IRepository <PublishedScreenshot> >();
            _mockedPackageAuthenticator          = new Mock <IPackageAuthenticator>();
            _mockedPackageLogEntryCreator        = new Mock <IPackageLogEntryCreator>();
            _mockedLatestVersionUpdater          = new Mock <ILatestVersionUpdater <PublishedPackage> >();
            _mockedMapper   = new Mock <IMapper>();
            _mockedDateTime = new Mock <IDateTime>();

            _mockedPackageRepository.SetupGet(pr => pr.Collection).Returns(new[] { _existingPackage }.AsQueryable());
            _mockedPublishedPackageRepository.SetupGet(pr => pr.Collection).Returns(new[] { new PublishedPackage() }.AsQueryable());
            _mockedMapper.Setup(m => m.Map <Package, PublishedPackage>(It.IsAny <Package>())).Returns(new PublishedPackage());

            _packagePublisher = new Infrastructure.Impl.PackagePublisher(_mockedPackageRepository.Object, _mockedPublishedPackageRepository.Object,
                                                                         _mockedPublishedScreenshotRepository.Object, _mockedPackageAuthenticator.Object,
                                                                         _mockedPackageLogEntryCreator.Object, _mockedMapper.Object, _mockedDateTime.Object, _mockedLatestVersionUpdater.Object);
        }
Ejemplo n.º 6
0
        public void SetUp()
        {
            _mockedPackageRepository = new Mock<IRepository<Package>>();
            _mockedPublishedPackageRepository = new Mock<IRepository<PublishedPackage>>();
            _mockedPublishedScreenshotRepository = new Mock<IRepository<PublishedScreenshot>>();
            _mockedPackageAuthenticator = new Mock<IPackageAuthenticator>();
            _mockedPackageLogEntryCreator = new Mock<IPackageLogEntryCreator>();
            _mockedLatestVersionUpdater = new Mock<ILatestVersionUpdater<PublishedPackage>>();
            _mockedMapper = new Mock<IMapper>();
            _mockedDateTime = new Mock<IDateTime>();

            _mockedPackageRepository.SetupGet(pr => pr.Collection).Returns(new[] { _existingPackage }.AsQueryable());
            _mockedPublishedPackageRepository.SetupGet(pr => pr.Collection).Returns(new[] { new PublishedPackage() }.AsQueryable());
            _mockedMapper.Setup(m => m.Map<Package, PublishedPackage>(It.IsAny<Package>())).Returns(new PublishedPackage());

            _packagePublisher = new Infrastructure.Impl.PackagePublisher(_mockedPackageRepository.Object, _mockedPublishedPackageRepository.Object,
                _mockedPublishedScreenshotRepository.Object, _mockedPackageAuthenticator.Object,
                _mockedPackageLogEntryCreator.Object, _mockedMapper.Object, _mockedDateTime.Object, _mockedLatestVersionUpdater.Object);
        }